diff --git a/src/assets/images/chart/charts/dial.png b/src/assets/images/chart/charts/dial.png new file mode 100644 index 00000000..778a8a61 Binary files /dev/null and b/src/assets/images/chart/charts/dial.png differ diff --git a/src/packages/components/Charts/Mores/Dial/config.ts b/src/packages/components/Charts/Mores/Dial/config.ts new file mode 100644 index 00000000..19a771b4 --- /dev/null +++ b/src/packages/components/Charts/Mores/Dial/config.ts @@ -0,0 +1,91 @@ +import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public' +import { DialConfig } from './index' +import { CreateComponentType } from '@/packages/index.d' +import cloneDeep from 'lodash/cloneDeep' + +export const includes = [] +const option = { + backgroundColor: '#0E1327', + dataset:70, + series: [{ + type: "gauge", + data: [{ + value: 70, + itemStyle: { // 指针样式 + color: '#2AF4FF' + } + }], + min: 0, //最小刻度 + max: 100, //最大刻度 + splitNumber: 10, //刻度数量 + center: ['50%', '55%'], + radius: '80%', + axisLine: { + lineStyle: { + color: [ + [0, 'rgba(0,212,230,0.5)'], + [1, 'rgba(28,128,245,0)'] + ], + width: 170 + } + }, + axisLabel: { // 文字样式 + color: '#eee', + fontSize: 14, + }, + axisTick: { + show: false, + }, + splitLine: { + show: false, + }, + detail: { + show: false, + }, + pointer: { + length: '80%', + width: 4 + }, + animationDuration: 2000, + }, + { + name: '外部刻度', + type: 'gauge', + center: ['50%', '55%'], + radius: '90%', + axisLine: { + show: true, + lineStyle: { + width: 25, + color: [ // 表盘外部颜色 + [0, '#1369E380'], + [1, '#1369E380'] + ], + } + }, + axisLabel: { + show:false, + }, + axisTick: { + splitNumber: 5, + lineStyle: { //刻度颜色 + color: '#42E5FB', + width: 2, + }, + }, + splitLine: { + length: 15, + lineStyle: { + color: '#42E5FB', + } + }, + }, + ] +}; + +export default class Config extends PublicConfigClass implements CreateComponentType { + public key: string = DialConfig.key + public chartConfig = cloneDeep(DialConfig) + // 图表配置项 + public option = echartOptionProfixHandle(option, includes) +} diff --git a/src/packages/components/Charts/Mores/Dial/config.vue b/src/packages/components/Charts/Mores/Dial/config.vue new file mode 100644 index 00000000..151a2f1d --- /dev/null +++ b/src/packages/components/Charts/Mores/Dial/config.vue @@ -0,0 +1,84 @@ + + + + \ No newline at end of file diff --git a/src/packages/components/Charts/Mores/Dial/index.ts b/src/packages/components/Charts/Mores/Dial/index.ts new file mode 100644 index 00000000..3b9b2923 --- /dev/null +++ b/src/packages/components/Charts/Mores/Dial/index.ts @@ -0,0 +1,14 @@ +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' +import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' + +export const DialConfig: ConfigType = { + key: 'Dial', + chartKey: 'VDial', + conKey: 'VCDial', + title: '表盘', + category: ChatCategoryEnum.MORE, + categoryName: ChatCategoryEnumName.MORE, + package: PackagesCategoryEnum.CHARTS, + chartFrame: ChartFrameEnum.COMMON, + image:'dial.png' +} diff --git a/src/packages/components/Charts/Mores/Dial/index.vue b/src/packages/components/Charts/Mores/Dial/index.vue new file mode 100644 index 00000000..cdd7c6d3 --- /dev/null +++ b/src/packages/components/Charts/Mores/Dial/index.vue @@ -0,0 +1,69 @@ + + + diff --git a/src/packages/components/Charts/Mores/index.ts b/src/packages/components/Charts/Mores/index.ts index d13eb446..84b74f78 100644 --- a/src/packages/components/Charts/Mores/index.ts +++ b/src/packages/components/Charts/Mores/index.ts @@ -4,7 +4,8 @@ import { FunnelConfig } from './Funnel/index' import { HeatmapConfig } from './Heatmap/index' import { WaterPoloConfig } from './WaterPolo/index' import { TreeMapConfig } from './TreeMap/index' +import { DialConfig } from './Dial/index' import { SankeyConfig } from './Sankey/index' import { GraphConfig } from './Graph/index' -export default [ProcessConfig, RadarConfig, FunnelConfig, HeatmapConfig, WaterPoloConfig, TreeMapConfig, GraphConfig, SankeyConfig] +export default [ProcessConfig, RadarConfig, FunnelConfig, HeatmapConfig, WaterPoloConfig, TreeMapConfig, GraphConfig, SankeyConfig, DialConfig]