From e13a33d05aafb52cb1967c5de534eede60a20f1a Mon Sep 17 00:00:00 2001 From: lang Date: Wed, 30 Dec 2015 16:13:44 +0800 Subject: [PATCH] Off previous event when updating symbol --- src/chart/helper/Symbol.js | 4 ++++ src/chart/pie/PieView.js | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/chart/helper/Symbol.js b/src/chart/helper/Symbol.js index 75b0810d7..568056500 100644 --- a/src/chart/helper/Symbol.js +++ b/src/chart/helper/Symbol.js @@ -194,6 +194,10 @@ define(function (require) { var size = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize')); + symbolPath.off('mouseover') + .off('mouseout') + .off('emphasis') + .off('normal'); if (itemModel.getShallow('hoverAnimation')) { var onEmphasis = function() { var ratio = size[1] / size[0]; diff --git a/src/chart/pie/PieView.js b/src/chart/pie/PieView.js index c22622648..ade968955 100644 --- a/src/chart/pie/PieView.js +++ b/src/chart/pie/PieView.js @@ -77,6 +77,7 @@ define(function (require) { this.updateData(data, idx, true); + // Hover to change label and labelLine function onEmphasis() { polyline.ignore = polyline.hoverIgnore; text.ignore = text.hoverIgnore; @@ -85,10 +86,10 @@ define(function (require) { polyline.ignore = polyline.normalIgnore; text.ignore = text.normalIgnore; } - this.on('emphasis', onEmphasis); - this.on('normal', onNormal); - this.on('mouseover', onEmphasis); - this.on('mouseout', onNormal); + this.on('emphasis', onEmphasis) + .on('normal', onNormal) + .on('mouseover', onEmphasis) + .on('mouseout', onNormal); } var piePieceProto = PiePiece.prototype; -- GitLab