You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2020/11/26 13:09:57 UTC

[incubator-echarts-examples] branch next updated: tweak example.

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

sushuang 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 79f515a  tweak example.
79f515a is described below

commit 79f515ac3994af1fcdef14fd1312754dc64c2194
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Nov 26 21:08:53 2020 +0800

    tweak example.
---
 .../data/doc-example/custom-transition-simple.js   | 78 +++++++++++++++++-----
 1 file changed, 62 insertions(+), 16 deletions(-)

diff --git a/public/data/doc-example/custom-transition-simple.js b/public/data/doc-example/custom-transition-simple.js
index d4a61d3..f1cc858 100644
--- a/public/data/doc-example/custom-transition-simple.js
+++ b/public/data/doc-example/custom-transition-simple.js
@@ -15,23 +15,69 @@ option = {
             var width = 50 + Math.random() * 150;
             var height = 50 + Math.random() * 150;
             var r = Math.random() * 40;
+            var fill = echarts.color.random();
+            var stroke = '#000';
+            var lineWidth = 2 + Math.round(Math.random() * 20);
+
             return {
-                type: 'rect',
-                x: pos[0],
-                y: pos[1],
-                shape: {
-                    x: -width / 2,
-                    y: -height / 2,
-                    width: width,
-                    height: height,
-                    r: r
-                },
-                style: {
-                    fill: echarts.color.random(),
-                    stroke: '#000',
-                    lineWidth: 2 + Math.round(Math.random() * 20)
-                },
-                transition: ['shape', 'style', 'x', 'y']
+                type: 'group',
+                children: [{
+                    type: 'rect',
+                    x: pos[0] / 2,
+                    y: pos[1],
+                    shape: {
+                        x: -width / 2,
+                        y: -height / 2,
+                        width: width,
+                        height: height,
+                        r: r
+                    },
+                    style: {
+                        fill: fill,
+                        stroke: stroke,
+                        lineWidth: lineWidth
+                    },
+                    textContent: {
+                        style: {
+                            text: 'Has transition',
+                            fontSize: 20
+                        }
+                    },
+                    textConfig: {
+                        position: 'bottom'
+                    },
+                    silent: true,
+                    // Has transition
+                    transition: ['shape', 'style', 'x', 'y']
+                }, {
+                    type: 'rect',
+                    x: pos[0] / 2 + params.coordSys.width / 2,
+                    y: pos[1],
+                    shape: {
+                        x: -width / 2,
+                        y: -height / 2,
+                        width: width,
+                        height: height,
+                        r: r
+                    },
+                    style: {
+                        fill: fill,
+                        stroke: stroke,
+                        lineWidth: lineWidth
+                    },
+                    textContent: {
+                        style: {
+                            text: 'No transition',
+                            fontSize: 20
+                        }
+                    },
+                    textConfig: {
+                        position: 'bottom'
+                    },
+                    silent: true,
+                    // No transition
+                    transition: []
+                }]
             };
         },
         data: [[Math.random(), Math.random()]]


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