feat: 新增堆叠图

This commit is contained in:
奔跑的面条
2024-12-16 20:05:07 +08:00
parent 6106a8fc5c
commit f48ada2859
10 changed files with 180 additions and 21 deletions
@@ -0,0 +1,24 @@
import { PublicConfigClass } from '@/packages/public'
import { VChartBarStackConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import { vChartOptionPrefixHandle } from '@/packages/public/vChart'
import data from './data.json'
import cloneDeep from 'lodash/cloneDeep'
import { type ISpec } from '@visactor/vchart'
export const includes = ['legends']
export const option: ISpec & { dataset?: any } = {
type: 'bar',
dataset: data,
xField: 'State',
yField: 'Population',
seriesField: 'Age',
stack: true
}
export default class Config extends PublicConfigClass implements CreateComponentType {
public key = VChartBarStackConfig.key
public chartConfig = cloneDeep(VChartBarStackConfig)
// 图表配置项
public option = vChartOptionPrefixHandle(option, includes)
}