提交 c0cf06cd 编写于 作者: L lang

Line temporary symbol not removed when re render bug fix

上级 cc456e12
......@@ -130,6 +130,15 @@ define(function(require) {
var isSymbolIgnore = !isCoordSysPolar && !seriesModel.get('showAllSymbol')
&& this._getSymbolIgnoreFunc(data, coordSys);
// Remove temporary symbols
var oldData = this._data;
oldData && oldData.eachItemGraphicEl(function (el, idx) {
if (el.__temp) {
group.remove(el);
oldData.setItemGraphicEl(idx, null);
}
});
// Initialization animation or coordinate system changed
if (
!(polyline
......@@ -236,7 +245,7 @@ define(function(require) {
var data = seriesModel.getData();
var dataIndex = queryDataIndex(data, payload);
if (dataIndex >= 0) {
if (dataIndex != null && dataIndex >= 0) {
var symbol = data.getItemGraphicEl(dataIndex);
if (!symbol) {
// Create a temporary symbol if it is not exists
......@@ -264,7 +273,7 @@ define(function(require) {
downplay: function (seriesModel, ecModel, api, payload) {
var data = seriesModel.getData();
var dataIndex = queryDataIndex(data, payload);
if (dataIndex >= 0) {
if (dataIndex != null && dataIndex >= 0) {
var symbol = data.getItemGraphicEl(dataIndex);
if (symbol) {
if (symbol.__temp) {
......
......@@ -6,13 +6,13 @@ define(function (require) {
var UNDEFINED = 'undefined';
var global = window;
var Float32Array = typeof global.Float32Array === UNDEFINED
? Array : global.Float32Array;
var Float64Array = typeof global.Float64Array === UNDEFINED
? Array : global.Float64Array;
var Int32Array = typeof global.Int32Array === UNDEFINED
? Array : global.Int32Array;
var dataCtors = {
'float': Float32Array,
'float': Float64Array,
'int': Int32Array,
// Ordinal data type can be string or int
'ordinal': Array,
......@@ -908,8 +908,9 @@ define(function (require) {
child.dataIndex = this.dataIndex;
};
/**
* Set graphic element relative to data. It can be set as null
* @param {number} idx
* @param {module:zrender/Element} el
* @param {module:zrender/Element} [el]
*/
listProto.setItemGraphicEl = function (idx, el) {
var hostModel = this.hostModel;
......@@ -922,8 +923,9 @@ define(function (require) {
if (el.type === 'group') {
el.traverse(setItemDataAndSeriesIndex, el);
}
this._graphicEls[idx] = el;
}
this._graphicEls[idx] = el;
};
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册