-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: column and bar plot support pixel width setting (#2156)
* feat(column-width): 柱条形图支持配置最小、最大宽度和组间间距和组内间距 * docs(💄): 增加柱条形图的最小、最大宽度设置的 demo 和文档 * revert: 暂时不开放 interval 间距设置 * docs(demo): 更新 demo 截图
- Loading branch information
Showing
19 changed files
with
229 additions
and
31 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
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,53 @@ | ||
import { Bar } from '@antv/g2plot'; | ||
|
||
const data = [ | ||
{ | ||
type: '家具家电', | ||
sales: 38, | ||
}, | ||
{ | ||
type: '粮油副食', | ||
sales: 52, | ||
}, | ||
{ | ||
type: '生鲜水果', | ||
sales: 61, | ||
}, | ||
{ | ||
type: '美容洗护', | ||
sales: 145, | ||
}, | ||
{ | ||
type: '母婴用品', | ||
sales: 48, | ||
}, | ||
{ | ||
type: '进口食品', | ||
sales: 38, | ||
}, | ||
{ | ||
type: '食品饮料', | ||
sales: 38, | ||
}, | ||
{ | ||
type: '家庭清洁', | ||
sales: 38, | ||
}, | ||
]; | ||
|
||
const barPlot = new Bar('container', { | ||
data, | ||
xField: 'sales', | ||
yField: 'type', | ||
barWidthRatio: 0.8, | ||
meta: { | ||
type: { | ||
alias: '类别', | ||
}, | ||
sales: { | ||
alias: '销售额', | ||
}, | ||
}, | ||
}); | ||
|
||
barPlot.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
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,59 @@ | ||
import { Column } from '@antv/g2plot'; | ||
|
||
const data = [ | ||
{ | ||
type: '家具家电', | ||
sales: 38, | ||
}, | ||
{ | ||
type: '粮油副食', | ||
sales: 52, | ||
}, | ||
{ | ||
type: '生鲜水果', | ||
sales: 61, | ||
}, | ||
{ | ||
type: '美容洗护', | ||
sales: 145, | ||
}, | ||
{ | ||
type: '母婴用品', | ||
sales: 48, | ||
}, | ||
{ | ||
type: '进口食品', | ||
sales: 38, | ||
}, | ||
{ | ||
type: '食品饮料', | ||
sales: 38, | ||
}, | ||
{ | ||
type: '家庭清洁', | ||
sales: 38, | ||
}, | ||
]; | ||
|
||
const columnPlot = new Column('container', { | ||
data, | ||
xField: 'type', | ||
yField: 'sales', | ||
columnWidthRatio: 0.8, | ||
xAxis: { | ||
label: { | ||
autoHide: true, | ||
autoRotate: false, | ||
}, | ||
}, | ||
meta: { | ||
type: { | ||
alias: '类别', | ||
}, | ||
sales: { | ||
alias: '销售额', | ||
}, | ||
}, | ||
}); | ||
|
||
columnPlot.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
Oops, something went wrong.