1export const PivotColumnPercentChart = memo(() => {
2 const vseed: VSeed = {
3 chartType: 'columnPercent',
4 dimensions: [
5 { id: 'category', alias: '类别', location: 'dimension' },
6 { id: 'date', alias: '日期', location: 'columnDimension' },
7 { id: 'region', alias: '区域', location: 'rowDimension' },
8 ],
9 measures: [
10 {
11 id: 'group-sales',
12 alias: '销售额分组',
13 children: [{ id: 'sales', alias: '销售额' }],
14 },
15 { id: 'profit', alias: '利润' },
16 ],
17 dataset: [
18 { date: '2019', region: 'east', category: 'Grocery', profit: 10, sales: 100 },
19 { date: '2019', region: 'east', category: 'Beverages', profit: 30, sales: 3200 },
20 { date: '2019', region: 'east', category: 'Dairy', profit: 30, sales: 300 },
21 { date: '2019', region: 'east', category: 'Household', profit: 50, sales: 2400 },
22 { date: '2019', region: 'east', category: 'Personal', profit: 40, sales: 500 },
23 { date: '2019', region: 'west', category: 'Grocery', profit: 10, sales: 100 },
24 { date: '2019', region: 'west', category: 'Beverages', profit: 30, sales: 3200 },
25 { date: '2019', region: 'west', category: 'Dairy', profit: 30, sales: 300 },
26 { date: '2019', region: 'west', category: 'Household', profit: 50, sales: 2400 },
27 { date: '2019', region: 'west', category: 'Personal', profit: 40, sales: 500 },
28
29 { date: '2020', region: 'east', category: 'Grocery', profit: 10, sales: 100 },
30 { date: '2020', region: 'east', category: 'Beverages', profit: 30, sales: 3200 },
31 { date: '2020', region: 'east', category: 'Dairy', profit: 30, sales: 300 },
32 { date: '2020', region: 'east', category: 'Household', profit: 50, sales: 2400 },
33 { date: '2020', region: 'east', category: 'Personal', profit: 40, sales: 500 },
34 { date: '2020', region: 'west', category: 'Grocery', profit: 10, sales: 100 },
35 { date: '2020', region: 'west', category: 'Beverages', profit: 30, sales: 3200 },
36 { date: '2020', region: 'west', category: 'Dairy', profit: 30, sales: 300 },
37 { date: '2020', region: 'west', category: 'Household', profit: 50, sales: 2400 },
38 { date: '2020', region: 'west', category: 'Personal', profit: 40, sales: 500 },
39 ],
40 }
41 return <PivotChart vseed={vseed} />
42})