Skip to content

Commit

Permalink
feat: compatible with g2plot 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kagawagao committed May 9, 2020
1 parent ef346ff commit f69b853
Show file tree
Hide file tree
Showing 5 changed files with 1,160 additions and 495 deletions.
6 changes: 5 additions & 1 deletion docs/examples/columns/basic/scrollbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@ const config: ColumnConfig = {
xField: '城市',
xAxis: {
visible: true,
autoHideLabel: true,
label: {
autoHide: true,
},
},
yAxis: {
visible: true,
label: {
visible: true,
formatter: (v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`),
},
},
yField: '销售额',
interactions: [
{
type: 'scrollbar',
cfg: {},
},
],
}
Expand Down
28 changes: 19 additions & 9 deletions docs/examples/grouped-column-line/basic.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'
import { GroupedColumnLineChart } from '@opd/g2plot-react'
import { GroupedColumnLineConfig } from '@antv/g2plot'

const uvBillData = [
{ time: '2019-03', value: 350, type: 'uv' },
Expand All @@ -16,18 +15,29 @@ const uvBillData = [
]

const transformData = [
{ time: '2019-03', value: 800 },
{ time: '2019-04', value: 600 },
{ time: '2019-05', value: 400 },
{ time: '2019-06', value: 380 },
{ time: '2019-07', value: 220 },
{ time: '2019-03', count: 800, name: 'a' },
{ time: '2019-04', count: 600, name: 'a' },
{ time: '2019-05', count: 400, name: 'a' },
{ time: '2019-06', count: 380, name: 'a' },
{ time: '2019-07', count: 220, name: 'a' },
{ time: '2019-03', count: 500, name: 'b' },
{ time: '2019-04', count: 300, name: 'b' },
{ time: '2019-05', count: 200, name: 'b' },
{ time: '2019-06', count: 180, name: 'b' },
{ time: '2019-07', count: 320, name: 'b' },
{ time: '2019-03', count: 200, name: 'c' },
{ time: '2019-04', count: 400, name: 'c' },
{ time: '2019-05', count: 300, name: 'c' },
{ time: '2019-06', count: 480, name: 'c' },
{ time: '2019-07', count: 120, name: 'c' },
]

const config: GroupedColumnLineConfig = {
const config = {
data: [uvBillData, transformData],
groupField: 'type',
columnGroupField: 'type',
lineSeriesField: 'name',
xField: 'time',
yField: ['value', 'value'],
yField: ['value', 'count'],
}

export default () => <GroupedColumnLineChart {...config} />
2 changes: 1 addition & 1 deletion docs/examples/stacked-column-line/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const transformData = [

const config: StackedColumnLineConfig = {
data: [uvBillData, transformData],
stackField: 'type',
columnStackField: 'type',
xField: 'time',
yField: ['value', 'value'],
}
Expand Down

0 comments on commit f69b853

Please sign in to comment.