export const PivotScatterChart = memo(() => {
const vseed: VSeed = {
chartType: 'scatter',
dimensions: [
{ id: 'category', alias: '类别', encoding: 'color' },
{ id: 'date', alias: '日期', encoding: 'column' },
{ id: 'region', alias: '区域', encoding: 'row' },
],
measures: [
{ id: 'sales', alias: '销售额', encoding: 'xAxis' },
{ id: 'profit', alias: '利润', encoding: 'yAxis' },
],
label: {
enable: false,
},
dataset: [
{ date: '2019', region: 'east', category: 'Grocery', profit: 10, sales: 100 },
{ date: '2019', region: 'east', category: 'Beverages', profit: 30, sales: 320 },
{ date: '2019', region: 'east', category: 'Dairy', profit: 30, sales: 300 },
{ date: '2019', region: 'east', category: 'Household', profit: 50, sales: 240 },
{ date: '2019', region: 'east', category: 'Personal', profit: 40, sales: 500 },
{ date: '2019', region: 'west', category: 'Grocery', profit: 10, sales: 100 },
{ date: '2019', region: 'west', category: 'Beverages', profit: 30, sales: 320 },
{ date: '2019', region: 'west', category: 'Dairy', profit: 30, sales: 300 },
{ date: '2019', region: 'west', category: 'Household', profit: 50, sales: 240 },
{ date: '2019', region: 'west', category: 'Personal', profit: 200, sales: 500 },
{ date: '2020', region: 'east', category: 'Grocery', profit: 10, sales: 100 },
{ date: '2020', region: 'east', category: 'Beverages', profit: 30, sales: 320 },
{ date: '2020', region: 'east', category: 'Dairy', profit: 30, sales: 300 },
{ date: '2020', region: 'east', category: 'Household', profit: 50, sales: 240 },
{ date: '2020', region: 'east', category: 'Personal', profit: 40, sales: 500 },
{ date: '2020', region: 'west', category: 'Grocery', profit: 10, sales: 100 },
{ date: '2020', region: 'west', category: 'Beverages', profit: 30, sales: 320 },
{ date: '2020', region: 'west', category: 'Dairy', profit: 30, sales: 300 },
{ date: '2020', region: 'west', category: 'Household', profit: 50, sales: 200 },
{ date: '2020', region: 'west', category: 'Personal', profit: 200, sales: 500 },
],
}
return <PivotChart vseed={vseed} />
})