-
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: 双轴图新增区间柱状图/百分比柱状图/阶梯折线图的支持 * fix: 更新 test * fix: 减少 deepmix 的使用 Co-authored-by: aiyin.lzy <nadia.lzy@antfin.com>
- Loading branch information
1 parent
5e13404
commit 79ec44b
Showing
18 changed files
with
343 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { DualAxes } from '@antv/g2plot'; | ||
|
||
const data = [ | ||
{ time: '2019-03', value: [200, 350], count: 800 }, | ||
{ time: '2019-04', value: [400, 650], count: 600 }, | ||
{ time: '2019-05', value: [150, 350], count: 400 }, | ||
{ time: '2019-06', value: [100, 450], count: 380 }, | ||
{ time: '2019-07', value: [500, 550], count: 220 }, | ||
]; | ||
|
||
const dualAxes = new DualAxes('container', { | ||
data: [data, data], | ||
xField: 'time', | ||
yField: ['value', 'count'], | ||
geometryOptions: [ | ||
{ | ||
geometry: 'column', | ||
color: '#5B8FF9', | ||
isRange: true, | ||
}, | ||
{ | ||
geometry: 'line', | ||
color: '#5AD8A6', | ||
lineStyle: { | ||
lineWidth: 2, | ||
stroke: '#5AD8A6', | ||
}, | ||
}, | ||
], | ||
}); | ||
|
||
dualAxes.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { DualAxes } from '@antv/g2plot'; | ||
|
||
const data = [ | ||
{ year: '1991', value: 3, count: 10 }, | ||
{ year: '1992', value: 4, count: 4 }, | ||
{ year: '1993', value: 3.5, count: 5 }, | ||
{ year: '1994', value: 5, count: 5 }, | ||
{ year: '1995', value: 4.9, count: 4.9 }, | ||
{ year: '1996', value: 6, count: 35 }, | ||
{ year: '1997', value: 7, count: 7 }, | ||
{ year: '1998', value: 9, count: 1 }, | ||
{ year: '1999', value: 13, count: 20 }, | ||
]; | ||
|
||
const dualAxes = new DualAxes('container', { | ||
data: [data, data], | ||
xField: 'year', | ||
yField: ['value', 'count'], | ||
geometryOptions: [ | ||
{ | ||
geometry: 'line', | ||
smooth: false, | ||
color: '#29cae4', | ||
stepType: 'vh', | ||
}, | ||
{ | ||
geometry: 'line', | ||
color: '#586bce', | ||
smooth: true, | ||
}, | ||
], | ||
}); | ||
|
||
dualAxes.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
42 changes: 42 additions & 0 deletions
42
examples/dual-axes/stacked-column-line/demo/stacked-percent-column-line.ts
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,42 @@ | ||
import { DualAxes } from '@antv/g2plot'; | ||
|
||
const uvBillData = [ | ||
{ time: '2019-03', value: 350, type: 'uv' }, | ||
{ time: '2019-04', value: 900, type: 'uv' }, | ||
{ time: '2019-05', value: 300, type: 'uv' }, | ||
{ time: '2019-06', value: 450, type: 'uv' }, | ||
{ time: '2019-07', value: 470, type: 'uv' }, | ||
{ time: '2019-03', value: 220, type: 'bill' }, | ||
{ time: '2019-04', value: 300, type: 'bill' }, | ||
{ time: '2019-05', value: 250, type: 'bill' }, | ||
{ time: '2019-06', value: 220, type: 'bill' }, | ||
{ time: '2019-07', value: 362, type: 'bill' }, | ||
]; | ||
|
||
const transformData = [ | ||
{ time: '2019-03', count: 800 }, | ||
{ time: '2019-04', count: 600 }, | ||
{ time: '2019-05', count: 400 }, | ||
{ time: '2019-06', count: 380 }, | ||
{ time: '2019-07', count: 220 }, | ||
]; | ||
|
||
const dualAxes = new DualAxes('container', { | ||
data: [uvBillData, transformData], | ||
xField: 'time', | ||
yField: ['value', 'count'], | ||
geometryOptions: [ | ||
{ | ||
geometry: 'column', | ||
isStack: true, | ||
isPercent: true, | ||
seriesField: 'type', | ||
}, | ||
{ | ||
geometry: 'line', | ||
color: '#FAA219', | ||
}, | ||
], | ||
}); | ||
|
||
dualAxes.render(); |
Oops, something went wrong.