mirror of
https://gitee.com/dromara/go-view.git
synced 2026-05-12 00:00:01 +08:00
feat: supply more chart types into vchart libs
This commit is contained in:
+62
-2
@@ -1,13 +1,25 @@
|
||||
import { IBarChartSpec } from '@visactor/vchart'
|
||||
import { IBarChartSpec, ILineChartSpec, IAreaChartSpec, IPieChartSpec, IFunnelChartSpec, IWordCloudChartSpec } from '@visactor/vchart'
|
||||
import { ICartesianAxisCommonSpec } from '@visactor/vchart/esm/component/axis'
|
||||
|
||||
|
||||
export enum ChatCategoryEnum {
|
||||
BAR = 'Bars',
|
||||
PIE = 'Pies',
|
||||
LINE = 'Lines',
|
||||
AREA = 'Areas',
|
||||
FUNNEL = 'Funnels',
|
||||
WORDCLOUD = 'WordClouds',
|
||||
SCATTER = 'Scatters',
|
||||
}
|
||||
|
||||
export enum ChatCategoryEnumName {
|
||||
BAR = '柱状图',
|
||||
PIE = '饼图',
|
||||
LINE = '折线图',
|
||||
AREA = '面积图',
|
||||
FUNNEL = '漏斗图',
|
||||
WORDCLOUD = '词云图',
|
||||
SCATTER = '散点图',
|
||||
}
|
||||
|
||||
export interface IBarOption extends Omit<IBarChartSpec, 'axes'> {
|
||||
@@ -21,6 +33,54 @@ export interface IBarOption extends Omit<IBarChartSpec, 'axes'> {
|
||||
} & ICartesianAxisCommonSpec
|
||||
}
|
||||
|
||||
export interface ILineOption extends Omit<ILineChartSpec, 'axes'> {
|
||||
category: ChatCategoryEnum.LINE
|
||||
type: 'line'
|
||||
xAxis?: {
|
||||
name: string
|
||||
} & ICartesianAxisCommonSpec
|
||||
yAxis?: {
|
||||
name: string
|
||||
} & ICartesianAxisCommonSpec
|
||||
}
|
||||
|
||||
export interface IAreaOption extends Omit<IAreaChartSpec, 'axes'> {
|
||||
category: ChatCategoryEnum.AREA
|
||||
type: 'area'
|
||||
xAxis?: {
|
||||
name: string
|
||||
} & ICartesianAxisCommonSpec
|
||||
yAxis?: {
|
||||
name: string
|
||||
} & ICartesianAxisCommonSpec
|
||||
}
|
||||
|
||||
export interface IPieOption extends IPieChartSpec {
|
||||
category: ChatCategoryEnum.PIE
|
||||
type: 'pie'
|
||||
}
|
||||
|
||||
export interface IFunnelOption extends IFunnelChartSpec {
|
||||
category: ChatCategoryEnum.FUNNEL
|
||||
type: 'funnel'
|
||||
}
|
||||
|
||||
export interface IWordCloudOption extends IWordCloudChartSpec {
|
||||
category: ChatCategoryEnum.WORDCLOUD
|
||||
type: 'wordCloud'
|
||||
}
|
||||
|
||||
export interface IScatterOption extends Omit<IAreaChartSpec, 'axes'> {
|
||||
category: ChatCategoryEnum.SCATTER
|
||||
type: 'scatter'
|
||||
xAxis?: {
|
||||
name: string
|
||||
} & ICartesianAxisCommonSpec
|
||||
yAxis?: {
|
||||
name: string
|
||||
} & ICartesianAxisCommonSpec
|
||||
}
|
||||
|
||||
// todo
|
||||
// export type IOption = IBarOption | ILineOption ....
|
||||
export type IOption = IBarOption
|
||||
export type IOption = IBarOption | IPieOption | ILineOption | IAreaOption | IFunnelOption | IScatterOption
|
||||
|
||||
Reference in New Issue
Block a user