1export const PivotScatterChart = memo(() => {
2 const vseed: VSeed = {
3 chartType: 'scatter',
4 dimensions: [
5 { id: 'category', alias: '类别', encoding: 'color' },
6 { id: 'date', alias: '日期', encoding: 'column' },
7 { id: 'region', alias: '区域', encoding: 'row' },
8 ],
9 measures: [
10 { id: 'sales', alias: '销售额', encoding: 'xAxis' },
11 { id: 'profit', alias: '利润', encoding: 'yAxis' },
12 ],
13 label: {
14 enable: false,
15 },
16 dataset: [
17 { date: '2019', region: 'east', category: 'Grocery', profit: 10, sales: 100 },
18 { date: '2019', region: 'east', category: 'Beverages', profit: 30, sales: 320 },
19 { date: '2019', region: 'east', category: 'Dairy', profit: 30, sales: 300 },
20 { date: '2019', region: 'east', category: 'Household', profit: 50, sales: 240 },
21 { date: '2019', region: 'east', category: 'Personal', profit: 40, sales: 500 },
22 { date: '2019', region: 'west', category: 'Grocery', profit: 10, sales: 100 },
23 { date: '2019', region: 'west', category: 'Beverages', profit: 30, sales: 320 },
24 { date: '2019', region: 'west', category: 'Dairy', profit: 30, sales: 300 },
25 { date: '2019', region: 'west', category: 'Household', profit: 50, sales: 240 },
26 { date: '2019', region: 'west', category: 'Personal', profit: 200, sales: 500 },
27
28 { date: '2020', region: 'east', category: 'Grocery', profit: 10, sales: 100 },
29 { date: '2020', region: 'east', category: 'Beverages', profit: 30, sales: 320 },
30 { date: '2020', region: 'east', category: 'Dairy', profit: 30, sales: 300 },
31 { date: '2020', region: 'east', category: 'Household', profit: 50, sales: 240 },
32 { date: '2020', region: 'east', category: 'Personal', profit: 40, sales: 500 },
33 { date: '2020', region: 'west', category: 'Grocery', profit: 10, sales: 100 },
34 { date: '2020', region: 'west', category: 'Beverages', profit: 30, sales: 320 },
35 { date: '2020', region: 'west', category: 'Dairy', profit: 30, sales: 300 },
36 { date: '2020', region: 'west', category: 'Household', profit: 50, sales: 200 },
37 { date: '2020', region: 'west', category: 'Personal', profit: 200, sales: 500 },
38 ],
39 }
40 return <PivotChart vseed={vseed} />
41})