This is an automated email from the ASF dual-hosted git repository.
wangzx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts-handbook.git
The following commit(s) were added to refs/heads/master by this push:
new d2b5413 fix: tweak example code for basic-bar, resolves #26.
d2b5413 is described below
commit d2b5413517891430a47cf3ad8ffecad09718087d
Author: plainheart <[email protected]>
AuthorDate: Thu Dec 2 14:04:35 2021 +0800
fix: tweak example code for basic-bar, resolves #26.
---
contents/en/how-to/chart-types/bar/basic-bar.md | 40 ++++++++++++++++---------
contents/zh/how-to/chart-types/bar/basic-bar.md | 40 ++++++++++++++++---------
2 files changed, 52 insertions(+), 28 deletions(-)
diff --git a/contents/en/how-to/chart-types/bar/basic-bar.md
b/contents/en/how-to/chart-types/bar/basic-bar.md
index c2eca19..f84e9da 100755
--- a/contents/en/how-to/chart-types/bar/basic-bar.md
+++ b/contents/en/how-to/chart-types/bar/basic-bar.md
@@ -76,14 +76,31 @@ option = {
yAxis: {},
series: [
{
- data: [10, 22, 28, 43, 49],
type: 'bar',
- stack: 'x'
- },
- {
- data: [5, 4, 3, 5, 10],
- type: 'bar',
- stack: 'x'
+ data: [
+ 10,
+ 22,
+ 28,
+ {
+ value: 43,
+ // Specify the style for single bar
+ itemStyle: {
+ color: '#91cc75',
+ shadowColor: '#91cc75',
+ borderType: [10, 5, 5],
+ opacity: 0.5
+ }
+ },
+ 49
+ ],
+ itemStyle: {
+ barBorderRadius: 5,
+ borderWidth: 1,
+ borderType: 'solid',
+ borderColor: '#73c0de',
+ shadowColor: '#5470c6',
+ shadowBlur: 3
+ }
}
]
};
@@ -103,14 +120,9 @@ option = {
yAxis: {},
series: [
{
- data: [10, 22, 28, 43, 49],
type: 'bar',
- stack: 'x'
- },
- {
- data: [5, 4, 3, 5, 10],
- type: 'bar',
- stack: 'x'
+ data: [10, 22, 28, 43, 49],
+ barWidth: '20%'
}
]
};
diff --git a/contents/zh/how-to/chart-types/bar/basic-bar.md
b/contents/zh/how-to/chart-types/bar/basic-bar.md
index b4b1e1b..7bec47c 100644
--- a/contents/zh/how-to/chart-types/bar/basic-bar.md
+++ b/contents/zh/how-to/chart-types/bar/basic-bar.md
@@ -70,14 +70,31 @@ option = {
yAxis: {},
series: [
{
- data: [10, 22, 28, 43, 49],
type: 'bar',
- stack: 'x'
- },
- {
- data: [5, 4, 3, 5, 10],
- type: 'bar',
- stack: 'x'
+ data: [
+ 10,
+ 22,
+ 28,
+ {
+ value: 43,
+ // 设置单个柱子的样式
+ itemStyle: {
+ color: '#91cc75',
+ shadowColor: '#91cc75',
+ borderType: [10, 5, 5],
+ opacity: 0.5
+ }
+ },
+ 49
+ ],
+ itemStyle: {
+ barBorderRadius: 5,
+ borderWidth: 1,
+ borderType: 'solid',
+ borderColor: '#73c0de',
+ shadowColor: '#5470c6',
+ shadowBlur: 3
+ }
}
]
};
@@ -97,14 +114,9 @@ option = {
yAxis: {},
series: [
{
- data: [10, 22, 28, 43, 49],
type: 'bar',
- stack: 'x'
- },
- {
- data: [5, 4, 3, 5, 10],
- type: 'bar',
- stack: 'x'
+ data: [10, 22, 28, 43, 49],
+ barWidth: '20%'
}
]
};
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]