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 12:55:40 UTC
[incubator-echarts-examples] branch next updated: add example
custom transition
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 c565294 add example custom transition
c565294 is described below
commit c565294daefa8eb261849204927f92abb6f95e19
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Nov 26 20:55:10 2020 +0800
add example custom transition
---
.../data/doc-example/custom-transition-simple.js | 47 ++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/public/data/doc-example/custom-transition-simple.js b/public/data/doc-example/custom-transition-simple.js
new file mode 100644
index 0000000..d4a61d3
--- /dev/null
+++ b/public/data/doc-example/custom-transition-simple.js
@@ -0,0 +1,47 @@
+option = {
+ animationDurationUpdate: 1500,
+ xAxis: {
+ min: 0,
+ max: 1
+ },
+ yAxis: {
+ min: 0,
+ max: 1
+ },
+ series: {
+ type: 'custom',
+ renderItem: function renderItem1(params, api) {
+ var pos = api.coord([api.value(0), api.value(1)]);
+ var width = 50 + Math.random() * 150;
+ var height = 50 + Math.random() * 150;
+ var r = Math.random() * 40;
+ 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']
+ };
+ },
+ data: [[Math.random(), Math.random()]]
+ }
+};
+
+setInterval(function () {
+ myChart.setOption({
+ series: {
+ data: [[Math.random(), Math.random()]]
+ }
+ });
+}, 2000);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org