mirror of
https://gitee.com/dromara/go-view.git
synced 2026-05-30 00:00:05 +08:00
feat: 新增堆叠图
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user