diff --git a/src/packages/components/Charts/Gauges/GaugeRing/config.ts b/src/packages/components/Charts/Gauges/GaugeRing/config.ts new file mode 100644 index 00000000..6d546675 --- /dev/null +++ b/src/packages/components/Charts/Gauges/GaugeRing/config.ts @@ -0,0 +1,69 @@ +import { echartOptionProfixHandle, publicConfig } from '@/packages/public' +import { GaugeRingConfig } from './index' +import { CreateComponentType } from '@/packages/index.d' +import dataJson from './data.json' + +const option = { + dataset: { ...dataJson }, + series: [ + { + type: 'gauge', + startAngle: 90, + endAngle: -270, + pointer: { + show: false + }, + progress: { + show: true, + overlap: false, + roundCap: true, + clip: false, + itemStyle: { + color:'#3263ec' + } + }, + axisLine: { + lineStyle: { + width: 40 + } + }, + splitLine: { + show: false, + distance: 0, + length: 10 + }, + axisTick: { + show: false + }, + axisLabel: { + show: false, + distance: 50 + }, + title: { + fontSize: 14, + offsetCenter: ['0%', '-10%'] + }, + detail: { + width: 50, + height: 14, + fontSize: 20, + color: '#3263ec', + borderColor: 'auto', + borderRadius: 20, + borderWidth: 0, + formatter: '{value}%', + valueAnimation: true, + offsetCenter: ['0%', '0%'] + } + } + ] +} + +export default class Config extends publicConfig implements CreateComponentType { + public key: string = GaugeRingConfig.key + + public chartConfig = GaugeRingConfig + + // 图表配置项 + public option = echartOptionProfixHandle(option,[]) +} diff --git a/src/packages/components/Charts/Gauges/GaugeRing/config.vue b/src/packages/components/Charts/Gauges/GaugeRing/config.vue new file mode 100644 index 00000000..15d16082 --- /dev/null +++ b/src/packages/components/Charts/Gauges/GaugeRing/config.vue @@ -0,0 +1,51 @@ + + + diff --git a/src/packages/components/Charts/Gauges/GaugeRing/data.json b/src/packages/components/Charts/Gauges/GaugeRing/data.json new file mode 100644 index 00000000..fd313c8d --- /dev/null +++ b/src/packages/components/Charts/Gauges/GaugeRing/data.json @@ -0,0 +1,6 @@ +{ + "dimensions": ["data"], + "source": [ + { "data":80 } + ] +} diff --git a/src/packages/components/Charts/Gauges/GaugeRing/index.ts b/src/packages/components/Charts/Gauges/GaugeRing/index.ts new file mode 100644 index 00000000..0d75f7c9 --- /dev/null +++ b/src/packages/components/Charts/Gauges/GaugeRing/index.ts @@ -0,0 +1,14 @@ +import image from '@/assets/images/chart/charts/pie-circle.png' +import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' +import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' + +export const GaugeRingConfig: ConfigType = { + key: 'GaugeRing', + chartKey: 'VGaugeRing', + conKey: 'VCGaugeRing', + title: '仪表盘-圆环', + category: ChatCategoryEnum.GAUGE, + categoryName: ChatCategoryEnumName.GAUGE, + package: PackagesCategoryEnum.CHARTS, + image +} diff --git a/src/packages/components/Charts/Gauges/GaugeRing/index.vue b/src/packages/components/Charts/Gauges/GaugeRing/index.vue new file mode 100644 index 00000000..74ed3fa0 --- /dev/null +++ b/src/packages/components/Charts/Gauges/GaugeRing/index.vue @@ -0,0 +1,64 @@ + + + diff --git a/src/packages/components/Charts/Gauges/index.ts b/src/packages/components/Charts/Gauges/index.ts new file mode 100644 index 00000000..f1d26b2b --- /dev/null +++ b/src/packages/components/Charts/Gauges/index.ts @@ -0,0 +1,3 @@ +import { GaugeRingConfig } from './GaugeRing/index' + +export default [GaugeRingConfig] \ No newline at end of file diff --git a/src/packages/components/Charts/index.d.ts b/src/packages/components/Charts/index.d.ts index e593ee5c..3a1d49a4 100644 --- a/src/packages/components/Charts/index.d.ts +++ b/src/packages/components/Charts/index.d.ts @@ -1,14 +1,16 @@ export enum ChatCategoryEnum { BAR = 'Bars', PIE = 'Pies', + GAUGE = 'Gauges', LINE = 'Lines', MAP = 'Maps', - MORE = 'Mores' + MORE = 'Mores', } export enum ChatCategoryEnumName { BAR = '柱状图', PIE = '饼图', + GAUGE = '仪表盘', LINE = '折线图', MAP = '地图', MORE = '更多' diff --git a/src/packages/components/Charts/index.ts b/src/packages/components/Charts/index.ts index 2dd3e54b..fc924d6f 100644 --- a/src/packages/components/Charts/index.ts +++ b/src/packages/components/Charts/index.ts @@ -1,7 +1,8 @@ import Bars from './Bars' import Pies from './Pies' +import Gauges from './Gauges' import Lines from './Lines' import Mores from './Mores' import Maps from './Maps' -export const ChartList = [...Bars, ...Pies, ...Lines, ...Maps, ...Mores] +export const ChartList = [...Bars, ...Pies, ...Gauges, ...Lines, ...Maps, ...Mores]