-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(bar): 条形图增加 bar 配置文档说明和demo (#2974)
* fix(test): 修复测试问题 * docs(bar): 条形图增加 shape 配置文档
- Loading branch information
Showing
7 changed files
with
61 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Bar } from '@antv/g2plot'; | ||
|
||
const data = [ | ||
{ year: '1951 年', value: 38 }, | ||
{ year: '1952 年', value: 52 }, | ||
{ year: '1956 年', value: 61 }, | ||
{ year: '1957 年', value: 145 }, | ||
{ year: '1958 年', value: 48 }, | ||
]; | ||
|
||
const bar = new Bar('container', { | ||
data, | ||
xField: 'value', | ||
yField: 'year', | ||
seriesField: 'year', | ||
legend: { | ||
position: 'top-left', | ||
}, | ||
// 自定义 shape | ||
shape: 'hollow-rect', | ||
}); | ||
|
||
bar.render(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters