You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/10/27 03:37:57 UTC
[incubator-echarts-examples] branch next updated: update examples.
update echarts version
This is an automated email from the ASF dual-hosted git repository.
shenyi 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 6fdffcc update examples. update echarts version
6fdffcc is described below
commit 6fdffccb36cffb0fab59b53e5b1606c4e549c24d
Author: pissang <bm...@gmail.com>
AuthorDate: Tue Oct 27 11:37:37 2020 +0800
update examples. update echarts version
---
.eslintrc.yaml | 1 -
public/data/calendar-charts.js | 1 +
public/data/line-draggable.js | 10 +--
public/data/pie-borderRadius.js | 51 ++++++++++++
public/data/pie-labelLine-adjust.js | 96 ++++++++++++++++++++++
public/data/pie-pattern.js | 2 +-
public/data/pie-roseType-simple.js | 5 +-
public/data/pie-roseType.js | 6 ++
public/data/scatter-anscombe-quartet.js | 4 +-
...sunburst-simple.js => sunburst-borderRadius.js} | 19 +++--
public/data/sunburst-simple.js | 2 +-
public/screenshot.html | 48 ++++++-----
src/common/config.js | 4 +-
13 files changed, 205 insertions(+), 44 deletions(-)
diff --git a/.eslintrc.yaml b/.eslintrc.yaml
index 527bb76..e4a2cee 100644
--- a/.eslintrc.yaml
+++ b/.eslintrc.yaml
@@ -177,7 +177,6 @@ rules:
no-const-assign: 2
# no-dupe-class-members: 2
no-this-before-super: 0
- no-var: 2
no-duplicate-imports: 2
prefer-rest-params: 0
unicode-bom: 2
diff --git a/public/data/calendar-charts.js b/public/data/calendar-charts.js
index b379980..736d443 100644
--- a/public/data/calendar-charts.js
+++ b/public/data/calendar-charts.js
@@ -2,6 +2,7 @@
title: Calendar Charts
category: 'calendar, scatter'
titleCN: 日力图
+shotWidth: 1000
difficulty: 11
*/
diff --git a/public/data/line-draggable.js b/public/data/line-draggable.js
index d1af826..46f102a 100644
--- a/public/data/line-draggable.js
+++ b/public/data/line-draggable.js
@@ -19,7 +19,7 @@ option = {
return 'X: ' + params.data[0].toFixed(2) + '<br>Y: ' + params.data[1].toFixed(2);
}
},
- grid: {
+ grid: {
top: '8%',
bottom: '12%',
},
@@ -39,22 +39,22 @@ option = {
{
type: 'slider',
xAxisIndex: 0,
- filterMode: 'empty'
+ filterMode: 'none'
},
{
type: 'slider',
yAxisIndex: 0,
- filterMode: 'empty'
+ filterMode: 'none'
},
{
type: 'inside',
xAxisIndex: 0,
- filterMode: 'empty'
+ filterMode: 'none'
},
{
type: 'inside',
yAxisIndex: 0,
- filterMode: 'empty'
+ filterMode: 'none'
}
],
series: [
diff --git a/public/data/pie-borderRadius.js b/public/data/pie-borderRadius.js
new file mode 100644
index 0000000..1218b5a
--- /dev/null
+++ b/public/data/pie-borderRadius.js
@@ -0,0 +1,51 @@
+/*
+title: Doughnut Chart with Rounded Corner
+category: pie
+titleCN: 圆角环形图
+difficulty: 1
+*/
+
+option = {
+ tooltip: {
+ trigger: 'item',
+ formatter: '{a} <br/>{b}: {c} ({d}%)'
+ },
+ legend: {
+ top: '5%',
+ left: 'center'
+ },
+ series: [
+ {
+ name: '访问来源',
+ type: 'pie',
+ radius: ['40%', '70%'],
+ avoidLabelOverlap: false,
+ itemStyle: {
+ borderRadius: 5,
+ borderColor: '#fff',
+ borderWidth: 2
+ },
+ label: {
+ show: false,
+ position: 'center'
+ },
+ emphasis: {
+ label: {
+ show: true,
+ fontSize: '40',
+ fontWeight: 'bold'
+ }
+ },
+ labelLine: {
+ show: false
+ },
+ data: [
+ {value: 1048, name: '搜索引擎'},
+ {value: 735, name: '直接访问'},
+ {value: 580, name: '邮件营销'},
+ {value: 484, name: '联盟广告'},
+ {value: 300, name: '视频广告'}
+ ]
+ }
+ ]
+};
\ No newline at end of file
diff --git a/public/data/pie-labelLine-adjust.js b/public/data/pie-labelLine-adjust.js
new file mode 100644
index 0000000..4fc81e0
--- /dev/null
+++ b/public/data/pie-labelLine-adjust.js
@@ -0,0 +1,96 @@
+/*
+title: Label Line Adjust
+category: pie
+titleCN: 饼图引导线调整
+difficulty: 3
+*/
+
+var datas = [
+ ////////////////////////////////////////
+ [
+ { name: '圣彼得堡来客', value: 5.6 },
+ { name: '陀思妥耶夫斯基全集', value: 1 },
+ { name: '史记精注全译(全6册)', value: 0.8 },
+ { name: '加德纳艺术通史', value: 0.5 },
+ { name: '表象与本质', value: 0.5 },
+ { name: '其它', value: 3.8 }
+ ],
+ // ////////////////////////////////////////
+ [
+ { name: '银河帝国5:迈向基地', value: 3.8 },
+ { name: '俞军产品方法论', value: 2.3 },
+ { name: '艺术的逃难', value: 2.2 },
+ { name: '第一次世界大战回忆录(全五卷)', value: 1.3 },
+ { name: 'Scrum 精髓', value: 1.2 },
+ { name: '其它', value: 5.7 }
+ ],
+
+ ////////////////////////////////////////
+ [
+ { name: '克莱因壶', value: 3.5 },
+ { name: '投资最重要的事', value: 2.8 },
+ { name: '简读中国史', value: 1.7 },
+ { name: '你当像鸟飞往你的山', value: 1.4 },
+ { name: '表象与本质', value: 0.5 },
+ { name: '其它', value: 3.8 }
+ ]
+];
+
+option = {
+ // color: ['#1B2550', '#2A3566', '#2B3C87', '#4853A7', '#858ED8', '#858ED8', '#A3ABEE'],
+ title: {
+ text: '阅读书籍分布',
+ left: 'center',
+ textStyle: {
+ color: '#999',
+ fontWeight: 'normal',
+ fontSize: 14
+ }
+ },
+ series: datas.map(function (data, idx) {
+ var top = idx * 33.3;
+ return {
+ type: 'pie',
+ radius: [20, 60],
+ top: top + '%',
+ height: '33.33%',
+ left: 'center',
+ width: 400,
+ itemStyle: {
+ borderColor: '#fff',
+ borderWidth: 1
+ },
+ label: {
+ alignTo: 'edge',
+ formatter: '{name|{b}}\n{time|{c} 小时}',
+ minMargin: 5,
+ edgeDistance: 10,
+ lineHeight: 15,
+ rich: {
+ time: {
+ fontSize: 10,
+ color: '#999'
+ }
+ }
+ },
+ labelLine: {
+ length: 15,
+ length2: 0,
+ maxSurfaceAngle: 80
+ },
+ labelLayout: function (params) {
+ var isLeft = params.labelRect.x < myChart.getWidth() / 2;
+ var points = params.labelLinePoints;
+ // Update the end point.
+ points[2][0] = isLeft
+ ? params.labelRect.x
+ : params.labelRect.x + params.labelRect.width;
+
+ return {
+ labelLinePoints: points
+ };
+ },
+ data: data
+ }
+ })
+};
\ No newline at end of file
diff --git a/public/data/pie-pattern.js b/public/data/pie-pattern.js
index 5cd7e19..cd2b346 100644
--- a/public/data/pie-pattern.js
+++ b/public/data/pie-pattern.js
@@ -2,7 +2,7 @@
title: Texture on Pie Chart
category: pie
titleCN: 饼图纹理
-difficulty: 1
+difficulty: 2
*/
var piePatternSrc = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBLAEsAAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAAACR0ZWNoAAAEMAAA [...]
diff --git a/public/data/pie-roseType-simple.js b/public/data/pie-roseType-simple.js
index 55812f5..ee88ead 100644
--- a/public/data/pie-roseType-simple.js
+++ b/public/data/pie-roseType-simple.js
@@ -7,7 +7,7 @@ difficulty: 2
option = {
legend: {
- top: 'bottom',
+ top: 'bottom'
},
toolbox: {
show: true,
@@ -25,6 +25,9 @@ option = {
radius: [50, 250],
center: ['50%', '50%'],
roseType: 'area',
+ itemStyle: {
+ borderRadius: 8
+ },
data: [
{value: 40, name: 'rose 1'},
{value: 38, name: 'rose 2'},
diff --git a/public/data/pie-roseType.js b/public/data/pie-roseType.js
index e59bc4a..6cf8867 100644
--- a/public/data/pie-roseType.js
+++ b/public/data/pie-roseType.js
@@ -36,6 +36,9 @@ option = {
radius: [20, 140],
center: ['25%', '50%'],
roseType: 'radius',
+ itemStyle: {
+ borderRadius: 5
+ },
label: {
show: false
},
@@ -61,6 +64,9 @@ option = {
radius: [20, 140],
center: ['75%', '50%'],
roseType: 'area',
+ itemStyle: {
+ borderRadius: 5
+ },
data: [
{value: 30, name: 'rose 1'},
{value: 28, name: 'rose 2'},
diff --git a/public/data/scatter-anscombe-quartet.js b/public/data/scatter-anscombe-quartet.js
index cd100e6..bd725d3 100644
--- a/public/data/scatter-anscombe-quartet.js
+++ b/public/data/scatter-anscombe-quartet.js
@@ -1,7 +1,7 @@
/*
-title: 'Anscombe's quartet'
+title: Anscomb's quartet
category: scatter
-titleCN: 'Anscombe's quartet'
+titleCN: Anscomb's quartet
difficulty: 1
*/
diff --git a/public/data/sunburst-simple.js b/public/data/sunburst-borderRadius.js
similarity index 81%
copy from public/data/sunburst-simple.js
copy to public/data/sunburst-borderRadius.js
index ab423d9..0ca3abe 100644
--- a/public/data/sunburst-simple.js
+++ b/public/data/sunburst-borderRadius.js
@@ -1,8 +1,8 @@
/*
-title: Basic Sunburst
+title: Sunburst with Rounded Corner
category: sunburst
-titleCN: Basic Sunburst
-difficulty: 1
+titleCN: 圆角旭日图
+difficulty: 2
*/
var data = [{
@@ -52,13 +52,14 @@ var data = [{
option = {
series: {
type: 'sunburst',
- // emphasis: {
- // focus: 'ancestor'
- // },
data: data,
- radius: [0, '90%'],
+ radius: [60, '90%'],
+ itemStyle: {
+ borderRadius: 7,
+ borderWidth: 2
+ },
label: {
- rotate: 'radial'
+ show: false
}
}
-};
+};
\ No newline at end of file
diff --git a/public/data/sunburst-simple.js b/public/data/sunburst-simple.js
index ab423d9..6dcbbcd 100644
--- a/public/data/sunburst-simple.js
+++ b/public/data/sunburst-simple.js
@@ -1,7 +1,7 @@
/*
title: Basic Sunburst
category: sunburst
-titleCN: Basic Sunburst
+titleCN: 基础旭日图
difficulty: 1
*/
diff --git a/public/screenshot.html b/public/screenshot.html
index b72d302..63c0f4f 100644
--- a/public/screenshot.html
+++ b/public/screenshot.html
@@ -6,12 +6,12 @@
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lodash@3.10.1/index.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/dat.gui@0.6.5/build/dat.gui.min.js"></script>
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.0.0-alpha.2/dist/echarts.js"></script>
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.0.0-alpha.2/map/js/china.js?_v_=1510583857922"></script>
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.0.0-alpha.2/map/js/world.js?_v_=1510583857922"></script>
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.0.0-alpha.2/dist/extension/dataTool.js?_v_=1510583857922"></script>
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.0.0-beta.2/dist/echarts.js"></script>
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.0.0-beta.2/map/js/china.js?_v_=1510583857922"></script>
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.0.0-beta.2/map/js/world.js?_v_=1510583857922"></script>
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.0.0-beta.2/dist/extension/dataTool.js?_v_=1510583857922"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=KOmVjPVUAey1G2E8zNhPiuQ6QiEmAwZu"></script>
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.0.0-alpha.2/dist/extension/bmap.js?_v_=1510583857922"></script>
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.0.0-beta.2/dist/extension/bmap.js?_v_=1510583857922"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-stat/dist/ecStat.min.js"></script>
<script type="text/javascript" src="../tool/seedrandom.js"></script>
<style>
@@ -72,6 +72,26 @@
return deferred;
}
+ echarts.registerPreprocessor(function (option) {
+ option.animation = false;
+ option.textStyle = {
+ fontSize: 14
+ };
+ if (option.series) {
+ if (!(option.series instanceof Array)) {
+ option.series = [option.series];
+ }
+ option.series.forEach(function (seriesOpt) {
+ if (seriesOpt.type === 'graph') {
+ seriesOpt.force = seriesOpt.force || {};
+ seriesOpt.force.layoutAnimation = false;
+ }
+ seriesOpt.progressive = 0;
+ seriesOpt.animation = false;
+ });
+ }
+ });
+
if (params.c) {
if (!window.ROOT_PATH) {
// When visiting `screenshot.html` In browser.
@@ -83,25 +103,9 @@
scriptTag.async = false;
scriptTag.src = `./${sourceFolder}/${params.c}.js`
document.body.appendChild(scriptTag);
+
scriptTag.onload = function () {
if (typeof option !== 'undefined' && option) {
- if (option.series) {
- if (!(option.series instanceof Array)) {
- option.series = [option.series];
- }
- option.series.forEach(function (seriesOpt) {
- if (seriesOpt.type === 'graph') {
- seriesOpt.force = seriesOpt.force || {};
- seriesOpt.force.layoutAnimation = false;
- }
- seriesOpt.progressive = 0;
- seriesOpt.animation = false;
- });
- }
- option.animation = false;
- option.textStyle = {
- fontSize: 14
- };
myChart.setOption(option);
}
}
diff --git a/src/common/config.js b/src/common/config.js
index 0dd2ca7..f20503c 100644
--- a/src/common/config.js
+++ b/src/common/config.js
@@ -120,8 +120,8 @@ export const SUPPORT_WEBP = (function () {
export const SCRIPT_URLS = {
localEChartsMinJS: 'http://localhost/echarts-next/dist/echarts.js',
- echartsMinJS: 'https://cdn.jsdelivr.net/npm/echarts@5.0.0-alpha.2/dist/echarts.min.js',
- echartsDir: 'https://cdn.jsdelivr.net/npm/echarts@5.0.0-alpha.2',
+ echartsMinJS: 'https://cdn.jsdelivr.net/npm/echarts@5.0.0-beta.2/dist/echarts.min.js',
+ echartsDir: 'https://cdn.jsdelivr.net/npm/echarts@5.0.0-beta.2',
echartsStatMinJS: 'https://cdn.jsdelivr.net/npm/echarts-stat/dist/ecStat.min.js',
echartsGLMinJS: 'https://cdn.jsdelivr.net/npm/echarts-gl/dist/echarts-gl.min.js',
datGUIMinJS: 'https://cdn.jsdelivr.net/npm/dat.gui@0.6.5/build/dat.gui.min.js',
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org