diff --git a/test/dataset-layout.html b/test/dataset-layout.html
index e892e545b4..42cf3d44d9 100644
--- a/test/dataset-layout.html
+++ b/test/dataset-layout.html
@@ -204,22 +204,26 @@
height: 500
});
+ var curDimension = 0;
chart && chart.on('updateAxisPointer', function (event) {
var xAxisInfo = event.axesInfo[0];
if (xAxisInfo) {
var dimension = xAxisInfo.value + 1;
- chart.setOption({
- series: {
- id: 'pie',
- label: {
- formatter: '{b}: {@[' + dimension + ']} ({d}%)'
- },
- encode: {
- value: dimension,
- tooltip: dimension
+ if (curDimension !== dimension) {
+ curDimension = dimension;
+ chart.setOption({
+ series: {
+ id: 'pie',
+ label: {
+ formatter: '{b}: {@[' + dimension + ']} ({d}%)'
+ },
+ encode: {
+ value: dimension,
+ tooltip: dimension
+ }
}
- }
- });
+ });
+ }
}
});
});
@@ -415,4 +419,4 @@