import type { EChartOption } from 'echarts'; import type { AuxiliaryLine } from './AuxiliaryLine'; import type { ChartStyles } from './DashboardStyles'; import type { DashboardWidgetType } from './DashboardWidgetType'; import type { Field } from './Field'; /** * 图表相关属性 */ export interface DashboardChart { /** * 主键id */ id?: string; /** * 图表名称 */ title: string; /** * 图表的类型 */ type: DashboardWidgetType.BAR_CHART | DashboardWidgetType.LINE_CHART | DashboardWidgetType.PIE_CHART | DashboardWidgetType.COLUMN_CHART | DashboardWidgetType.METRIC_CHART; /** * 维度 * 如果是直角坐标系的图表,则特指y轴方向的维度 */ yFields?: Field[]; /** * 数据源查看范围 */ permission?: string; /** * 图例配置 */ legend?: any; /** * x轴配置 */ xAxis?: any; /** * y轴配置 */ yAxis?: any; /** * 数据标签配置 */ label?: any; /** * 维度 */ xFields?: Field[]; /** * 指标 */ metrics?: Field[]; /** * 辅助线 */ guideline?: AuxiliaryLine[]; /** * 对应的表单id或数据集合主模型id */ formId?: string; /** * 数据集合的id */ dataSetId?: string; /** * 表单名称 */ formName?: string; /** * 自定义的指标字段 */ formulas?: any[]; /** * 过滤条件 */ filter?: FilterCondition[]; /** * 线形 */ smooth?: string; /** * 标记点 */ symbol?: string[]; /** * 控制数据显示条数 */ sliceNumber?: string[]; /** * 显示前几条数据 */ sliceNumberValue?: string; /** * 文字大小 */ size?: string; /** * 排序字段 */ sort?: SortInfo[]; /** * 图表定制样式 */ styles?: ChartStyles; /** *是否显示背景网格 * * @type {string[]} * @memberof DashboardChart */ splitLine?: { hidden: string[]; }; /** * 指标图是否显示工计 */ showTotal?: string[]; /** * 漏斗图的底部形状 */ bottomShape?: 'culet' | 'flat'; /** * 漏斗图的斜率 */ gradient?: 'smooth' | 'reality'; /** * 堆叠面积图是否显示堆叠效果 */ stack?: '0' | '1'; /** * 图表直角坐标系相关配置 */ grid?: EChartOption.Grid; /** * 是否是未保存的临时图表 */ temp?: boolean; /** * 地图图例相关配置 */ visualMap?: EChartOption.VisualMap; /** * 地图是否支持钻取 */ isDrillDown?: '0' | '1'; /** * 钻取字段 */ drillField?: Field; /** *是否是数据集合的图表 */ isDataSet?: boolean; } /** * 排序字段 */ export interface SortInfo { /** * 排序字段id */ sortFieldId: string; /** * 排序方式 */ sortType: 'desc' | 'asc'; /** * 排序字段的类型,用于区别一个字段同时作为维护和指标的场景 */ type: 'METRICS' | 'DIMENSION'; /** * 子表单id * * @since 1.16.0 */ subFormFieldName?: string; } export interface FilterCondition { /** * 字段id */ field: string; /** * 字段名称 */ title: string; /** * 字段类型 */ fieldType: string; /** * 子表单id * * @since 1.16.0 */ subFormFieldName?: string; /** * 对比方式 */ method?: string; /** * 值 */ value?: string; formId?: string; }