diff --git a/src/chart/pie/PieView.js b/src/chart/pie/PieView.js index dc9f635f3c..2d9d609703 100644 --- a/src/chart/pie/PieView.js +++ b/src/chart/pie/PieView.js @@ -180,31 +180,36 @@ piePieceProto.updateData = function (data, idx, firstCreate) { var withAnimation = !firstCreate && animationTypeUpdate === 'transition'; this._updateLabel(data, idx, withAnimation); - this.highDownOnUpdate = (itemModel.get('hoverAnimation') && seriesModel.isAnimationEnabled()) + this.highDownOnUpdate = !seriesModel.get('silent') ? function (fromState, toState) { + const hasAnimation = seriesModel.isAnimationEnabled() && itemModel.get('hoverAnimation'); if (toState === 'emphasis') { labelLine.ignore = labelLine.hoverIgnore; labelText.ignore = labelText.hoverIgnore; // Sector may has animation of updating data. Force to move to the last frame // Or it may stopped on the wrong shape - sector.stopAnimation(true); - sector.animateTo({ - shape: { - r: layout.r + seriesModel.get('hoverOffset') - } - }, 300, 'elasticOut'); + if (hasAnimation) { + sector.stopAnimation(true); + sector.animateTo({ + shape: { + r: layout.r + seriesModel.get('hoverOffset') + } + }, 300, 'elasticOut'); + } } else { labelLine.ignore = labelLine.normalIgnore; labelText.ignore = labelText.normalIgnore; - sector.stopAnimation(true); - sector.animateTo({ - shape: { - r: layout.r - } - }, 300, 'elasticOut'); + if (hasAnimation) { + sector.stopAnimation(true); + sector.animateTo({ + shape: { + r: layout.r + } + }, 300, 'elasticOut'); + } } } : null; diff --git a/test/pie-animation.html b/test/pie-animation.html index 679b50bbb8..5c0cec6d8f 100644 --- a/test/pie-animation.html +++ b/test/pie-animation.html @@ -31,7 +31,8 @@ html, body, #main1, - #main2 { + #main2, + #main3 { width: 100%; height: 250px; margin: 0; @@ -57,6 +58,9 @@
+
Should display labels on emphasis if no animation
+
+ + + + + \ No newline at end of file diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index 16695409ad..35846a21be 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -109,6 +109,7 @@ "pie": 1, "pie-action": 1, "pie-alignTo": 4, + "pie-animation": 1, "pie-calculable": 1, "polar-rounded": 3, "polarLine": 1, diff --git a/test/runTest/actions/pie-animation.json b/test/runTest/actions/pie-animation.json new file mode 100644 index 0000000000..b788d989bc --- /dev/null +++ b/test/runTest/actions/pie-animation.json @@ -0,0 +1 @@ +[{"name":"Action 1","ops":[{"type":"mousemove","time":2246,"x":225,"y":453},{"type":"mousemove","time":2453,"x":225,"y":453},{"type":"mousemove","time":2845,"x":225,"y":453},{"type":"mousemove","time":3045,"x":268,"y":465},{"type":"mousemove","time":3245,"x":312,"y":468},{"type":"mousemove","time":3449,"x":328,"y":469},{"type":"mousemove","time":3669,"x":328,"y":469},{"type":"screenshot","time":4152}],"scrollY":390,"scrollX":0,"timestamp":1583724042816}] \ No newline at end of file