This is an automated email from the ASF dual-hosted git repository.

wangzx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts.git


The following commit(s) were added to refs/heads/master by this push:
     new 2e010c78a test: update dataset-layout.html (#19373)
2e010c78a is described below

commit 2e010c78a2571df185a4092675745391474686d3
Author: Vincent <[email protected]>
AuthorDate: Tue Feb 27 17:52:55 2024 +0800

    test: update dataset-layout.html (#19373)
    
    Fixed an issue where repeated rendering caused stalling
    
    ---------
    
    Co-authored-by: miracleren <[email protected]>
---
 test/dataset-layout.html | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/test/dataset-layout.html b/test/dataset-layout.html
index e892e545b..42cf3d44d 100644
--- a/test/dataset-layout.html
+++ b/test/dataset-layout.html
@@ -204,22 +204,26 @@ under the License.
                     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 @@ under the License.
 
 
     </body>
-</html>
\ No newline at end of file
+</html>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to