You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2022/08/04 07:53:59 UTC

[echarts] 01/01: test(pie): tweak pie-percent case - add time log, percentPrecision & label formatter.

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

wangzx pushed a commit to branch improve-pie-performance
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit 77ee2a1ccb1f2bf8de7f2f9cf71b4a22deb93a09
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Thu Aug 4 15:51:48 2022 +0800

    test(pie): tweak pie-percent case - add time log, percentPrecision & label formatter.
---
 test/pie-percent.html | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/test/pie-percent.html b/test/pie-percent.html
index 9bbe0aa42..06372ba5a 100644
--- a/test/pie-percent.html
+++ b/test/pie-percent.html
@@ -46,9 +46,7 @@ under the License.
 
         <script>
         require([
-            'echarts',
-            // 'map/js/china',
-            // './data/nutrients.json'
+            'echarts'
         ], function (echarts) {
             var option;
             var data = [];
@@ -62,17 +60,27 @@ under the License.
                 series: {
                     type: 'pie',
                     data: data,
+                    percentPrecision: 5,
+                    label: {
+                        formatter: '{b} {d}%'
+                    }
                 }
             };
 
             var chart = testHelper.create(echarts, 'main0', {
                 title: [
                     'Test Pie performance'
-                ],
-                option: option
-                // height: 300,
-                // buttons: [{text: 'btn-txt', onclick: function () {}}],
-                // recordCanvas: true,
+                ]
+            });
+
+            var startTs = performance.now();
+            chart.setOption(option);
+
+            chart.on('finished', function () {
+                var endTs = performance.now();
+                var time = endTs - startTs;
+                console.log('Finished in ' + time + 'ms');
+                startTs = endTs;
             });
         });
         </script>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org