mirror of
https://gitee.com/dromara/go-view.git
synced 2026-05-30 00:00:05 +08:00
feat: 新增数据mock,数据字段映射
This commit is contained in:
@@ -14,7 +14,7 @@ export const option: IBarOption & { dataset?: any } = {
|
||||
dataset: data,
|
||||
stack: true,
|
||||
xField: ['year', 'type'],
|
||||
yField: 'value',
|
||||
yField: ['value'],
|
||||
seriesField: 'type',
|
||||
// 业务配置(后续会被转换为图表spec)
|
||||
category: VChartBarCommonConfig.category,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
{ "type": "Autocracies", "year": "2000", "value": 89 },
|
||||
{ "type": "Autocracies", "year": "2010", "value": 80 },
|
||||
{ "type": "Autocracies", "year": "2018", "value": 80 },
|
||||
|
||||
{ "type": "Democracies", "year": "1930", "value": 22 },
|
||||
{ "type": "Democracies", "year": "1940", "value": 13 },
|
||||
{ "type": "Democracies", "year": "1950", "value": 25 },
|
||||
|
||||
@@ -12,9 +12,9 @@ export const option: IBarOption & { dataset?: any } = {
|
||||
// 图表配置
|
||||
type: 'bar',
|
||||
dataset: data,
|
||||
xField: 'State',
|
||||
yField: 'Population',
|
||||
seriesField: 'Age',
|
||||
xField: ['type'],
|
||||
yField: ['value'],
|
||||
seriesField: 'year',
|
||||
stack: true,
|
||||
// 业务配置(后续会被转换为图表spec)
|
||||
category: VChartBarStackConfig.category,
|
||||
|
||||
@@ -1,79 +1,16 @@
|
||||
{
|
||||
"values": [
|
||||
{
|
||||
"State": "WY",
|
||||
"Age": "Under 5 Years",
|
||||
"Population": 25635
|
||||
},
|
||||
{
|
||||
"State": "WY",
|
||||
"Age": "5 to 13 Years",
|
||||
"Population": 1890
|
||||
},
|
||||
{
|
||||
"State": "WY",
|
||||
"Age": "14 to 17 Years",
|
||||
"Population": 9314
|
||||
},
|
||||
{
|
||||
"State": "DC",
|
||||
"Age": "Under 5 Years",
|
||||
"Population": 30352
|
||||
},
|
||||
{
|
||||
"State": "DC",
|
||||
"Age": "5 to 13 Years",
|
||||
"Population": 20439
|
||||
},
|
||||
{
|
||||
"State": "DC",
|
||||
"Age": "14 to 17 Years",
|
||||
"Population": 10225
|
||||
},
|
||||
{
|
||||
"State": "VT",
|
||||
"Age": "Under 5 Years",
|
||||
"Population": 38253
|
||||
},
|
||||
{
|
||||
"State": "VT",
|
||||
"Age": "5 to 13 Years",
|
||||
"Population": 42538
|
||||
},
|
||||
{
|
||||
"State": "VT",
|
||||
"Age": "14 to 17 Years",
|
||||
"Population": 15757
|
||||
},
|
||||
{
|
||||
"State": "ND",
|
||||
"Age": "Under 5 Years",
|
||||
"Population": 51896
|
||||
},
|
||||
{
|
||||
"State": "ND",
|
||||
"Age": "5 to 13 Years",
|
||||
"Population": 67358
|
||||
},
|
||||
{
|
||||
"State": "ND",
|
||||
"Age": "14 to 17 Years",
|
||||
"Population": 18794
|
||||
},
|
||||
{
|
||||
"State": "AK",
|
||||
"Age": "Under 5 Years",
|
||||
"Population": 72083
|
||||
},
|
||||
{
|
||||
"State": "AK",
|
||||
"Age": "5 to 13 Years",
|
||||
"Population": 85640
|
||||
},
|
||||
{
|
||||
"State": "AK",
|
||||
"Age": "14 to 17 Years",
|
||||
"Population": 22153
|
||||
}
|
||||
{ "type": "Nail polish", "year": "Africa", "value": 590 },
|
||||
{ "type": "Nail polish", "year": "EU", "value": 450 },
|
||||
{ "type": "Nail polish", "year": "China", "value": 474 },
|
||||
{ "type": "Nail polish", "year": "USA", "value": 459 },
|
||||
{ "type": "Eyebrow pencil", "year": "Africa", "value": 746 },
|
||||
{ "type": "Eyebrow pencil", "year": "EU", "value": 176 },
|
||||
{ "type": "Eyebrow pencil", "year": "China", "value": 210 },
|
||||
{ "type": "Eyebrow pencil", "year": "USA", "value": 775 },
|
||||
{ "type": "Rouge", "year": "Africa", "value": 896 },
|
||||
{ "type": "Rouge", "year": "EU", "value": 784 },
|
||||
{ "type": "Rouge", "year": "China", "value": 866 },
|
||||
{ "type": "Rouge", "year": "USA", "value": 899 }
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user