You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by ov...@apache.org on 2021/07/05 06:29:29 UTC

[echarts-www] 01/02: WIP

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

ovilia pushed a commit to branch feat-bar-racing
in repository https://gitbox.apache.org/repos/asf/echarts-www.git

commit 98003c652ac3e6da77f786a02f1ddb5c8f7c6813
Author: Ovilia <zw...@gmail.com>
AuthorDate: Thu Dec 31 12:37:09 2020 +0800

    WIP
---
 _jade/zh/bar-racing.jade | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/_jade/zh/bar-racing.jade b/_jade/zh/bar-racing.jade
index 93a687d..e71f891 100644
--- a/_jade/zh/bar-racing.jade
+++ b/_jade/zh/bar-racing.jade
@@ -62,7 +62,6 @@ block content
 block extra_js
     script(src='https://cdn.jsdelivr.net/npm/handsontable@6.2.2/dist/handsontable.js')
     script(src='http://localhost/echarts/dist/echarts.js')
-    script(src='http://localhost/echarts-examples/public/data/asset/js/myTransform.js')
     script(type='text/javascript').
         document.getElementById('nav-contribute').className = 'active';
 
@@ -177,7 +176,6 @@ block extra_js
             }
         });
 
-        echarts.registerTransform(myTransform.id);
         var chart = echarts.init($('#bar-race-preview')[0]);
 
         var timeoutHandlers = [];
@@ -239,7 +237,11 @@ block extra_js
                     type: 'bar',
                     data: getChartData(0),
                     realtimeSort: true,
-                    colorBy: 'item'
+                    colorBy: 'item',
+                    label: {
+                        show: true,
+                        position: 'insideRight'
+                    }
                 }],
                 animationDurationUpdate: 5000,
                 animationEasing: 'linear',
@@ -271,3 +273,26 @@ block extra_js
                 })(i);
             }
         }
+
+        function download() {
+            saveFile()
+        }
+
+        function saveFile(data, name, type) {
+            if (isSafari()) {
+                window.open('data:text/plain;charset=utf-8,' + encodeURIComponent(data));
+            } else {
+                try {
+                    var file = new Blob([data], {type: type});
+                    saveAs(file, name);
+                } catch(e) {
+                    console.error(e);
+                    window.open('data:text/plain;charset=utf-8,' + encodeURIComponent(data));
+                }
+            }
+        }
+
+        function isSafari() {
+            return navigator.userAgent.indexOf('Safari') > 0 &&
+                navigator.userAgent.indexOf('Chrome') < 0;
+        }

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