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 2020/11/23 06:11:46 UTC

[incubator-echarts-examples] branch next updated: example: update custom gauge

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

wangdd pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-echarts-examples.git


The following commit(s) were added to refs/heads/next by this push:
     new 9d92070  example: update custom gauge
9d92070 is described below

commit 9d92070124be0fb3280e37b445c20b75b031bf38
Author: Wdingding <wa...@gmail.com>
AuthorDate: Mon Nov 23 14:08:02 2020 +0800

    example: update custom gauge
---
 public/data/custom-gauge.js | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/public/data/custom-gauge.js b/public/data/custom-gauge.js
index 0241981..6041136 100644
--- a/public/data/custom-gauge.js
+++ b/public/data/custom-gauge.js
@@ -12,17 +12,17 @@ var _datasourceList = [
     [[1, 131]],
     [[1, 32]],
     [[1, 103]],
-    [[1, 66]],
+    [[1, 66]]
 ];
 var _panelImageURL = ROOT_PATH + '/data/asset/img/custom-gauge-panel.png';
 var _animationDuration = 1000;
 var _animationDurationUpdate = 1000;
-var _animationEasingUpdate = 'elasticOut';
+var _animationEasingUpdate = 'quarticInOut';
 var _valOnRadianMax = 200;
-var _outerRadius = 100;
-var _innerRadius = 85;
+var _outerRadius = 200;
+var _innerRadius = 170;
 var _pointerInnerRadius = 40;
-var _insidePanelRadius = 65;
+var _insidePanelRadius = 140;
 var _currentDataIndex = 0;
 
 function renderItem(params, api) {
@@ -61,7 +61,7 @@ function renderItem(params, api) {
             clipPath: {
                 type: 'polygon',
                 shape: {
-                    points: makePionterPoints(params, polarEndRadian),
+                    points: makePionterPoints(params, polarEndRadian)
                 },
                 extra: {
                     polarEndRadian: polarEndRadian,
@@ -74,7 +74,7 @@ function renderItem(params, api) {
                         makePionterPoints(params, apiDuring.getExtra('polarEndRadian'))
                     );
                 }
-            },
+            }
         }, {
             type: 'circle',
             shape: {
@@ -87,7 +87,7 @@ function renderItem(params, api) {
                 shadowBlur: 25,
                 shadowOffsetX: 0,
                 shadowOffsetY: 0,
-                shadowColor: 'rgb(0,0,50)'
+                shadowColor: 'rgba(76,107,167,0.4)'
             }
         }, {
             type: 'text',
@@ -98,7 +98,8 @@ function renderItem(params, api) {
             },
             style: {
                 text: makeText(valOnRadian),
-                fontSize: 40,
+                fontSize: 50,
+                fontWeight: 700,
                 x: params.coordSys.cx,
                 y: params.coordSys.cy,
                 fill: 'rgb(0,50,190)',
@@ -133,7 +134,7 @@ function makeText(valOnRadian) {
     if (valOnRadian < -10) {
         alert('illegal during val: ' + valOnRadian);
     }
-    return (valOnRadian / _valOnRadianMax * 100).toFixed(0) + '%'
+    return (valOnRadian / _valOnRadianMax * 100).toFixed(0) + '%';
 }
 
 option = {
@@ -182,4 +183,4 @@ app.config = {
             }
         });
     }
-};
+};
\ No newline at end of file


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