From 99366efc8cdbe2ffa3f8d428d1b432ada0f63bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Mon, 16 Jun 2025 16:10:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=9F=B1=E7=8A=B6?= =?UTF-8?q?=E5=9B=BE=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/GoVChart/index.vue | 2 +- .../Pages/VChartItemSetting/Axis.vue | 6 +- .../Pages/VChartItemSetting/Bar.vue | 52 +++++++++++++++++ .../Pages/VChartItemSetting/Label.vue | 38 ++++++++++++ .../Pages/VChartItemSetting/index.ts | 4 +- .../chartConfiguration/vcharts/label.ts | 58 +++++++++++++++++++ .../VChart/Bars/VChartBarCommon/config.ts | 2 +- .../VChart/Bars/VChartBarCommon/config.vue | 6 +- .../VChart/Bars/VChartBarCrossrange/config.ts | 13 ++++- .../Bars/VChartBarCrossrange/config.vue | 6 +- .../VChart/Bars/VChartBarStack/config.ts | 12 +++- .../VChart/Bars/VChartBarStack/config.vue | 6 +- .../VChart/Pies/VChartPie/config.vue | 8 +-- src/settings/vchartThemes/global.theme.json | 26 ++++++++- 14 files changed, 221 insertions(+), 18 deletions(-) create mode 100644 src/components/Pages/VChartItemSetting/Bar.vue create mode 100644 src/components/Pages/VChartItemSetting/Label.vue diff --git a/src/components/GoVChart/index.vue b/src/components/GoVChart/index.vue index 5d28ff84..1611105f 100644 --- a/src/components/GoVChart/index.vue +++ b/src/components/GoVChart/index.vue @@ -211,7 +211,7 @@ const createOrUpdateChart = ( const spec = transformHandler[chartProps.category || '']?.(chartProps) chart.updateSpec({ ...spec, data: toRaw(chartProps.dataset), dataset: undefined }, false, undefined, { change: false, - reMake: false, + reMake: true, reAnimate: true }) return true diff --git a/src/components/Pages/VChartItemSetting/Axis.vue b/src/components/Pages/VChartItemSetting/Axis.vue index 76f1135f..daf2e1b4 100644 --- a/src/components/Pages/VChartItemSetting/Axis.vue +++ b/src/components/Pages/VChartItemSetting/Axis.vue @@ -15,15 +15,15 @@ - + - + - + diff --git a/src/components/Pages/VChartItemSetting/Bar.vue b/src/components/Pages/VChartItemSetting/Bar.vue new file mode 100644 index 00000000..f031fb2e --- /dev/null +++ b/src/components/Pages/VChartItemSetting/Bar.vue @@ -0,0 +1,52 @@ + + + diff --git a/src/components/Pages/VChartItemSetting/Label.vue b/src/components/Pages/VChartItemSetting/Label.vue new file mode 100644 index 00000000..f1df09da --- /dev/null +++ b/src/components/Pages/VChartItemSetting/Label.vue @@ -0,0 +1,38 @@ + + + diff --git a/src/components/Pages/VChartItemSetting/index.ts b/src/components/Pages/VChartItemSetting/index.ts index dd8f7f0c..76dcaa44 100644 --- a/src/components/Pages/VChartItemSetting/index.ts +++ b/src/components/Pages/VChartItemSetting/index.ts @@ -1,4 +1,6 @@ import VChartGlobalSetting from './VChartGlobalSetting.vue' import Axis from './Axis.vue' +import Label from './Label.vue' +import Bar from './Bar.vue' -export { VChartGlobalSetting, Axis } +export { VChartGlobalSetting, Axis, Label, Bar } diff --git a/src/packages/chartConfiguration/vcharts/label.ts b/src/packages/chartConfiguration/vcharts/label.ts index 0e338162..f7d9ca7f 100644 --- a/src/packages/chartConfiguration/vcharts/label.ts +++ b/src/packages/chartConfiguration/vcharts/label.ts @@ -20,5 +20,63 @@ export const labelConfig = { label: '内部-居中', value: 'inside-center' } + ], + barPosition: [ + { + label: '外部', + value: 'outside' + }, + { + label: '内部', + value: 'inside' + }, + { + label: '顶部', + value: 'top' + }, + { + label: '底部', + value: 'bottom' + }, + { + label: '左侧', + value: 'left' + }, + { + label: '右侧', + value: 'right' + }, + { + label: '内部-顶', + value: 'inside-top' + }, + { + label: '内部-底', + value: 'inside-bottom' + }, + { + label: '内部-右', + value: 'inside-right' + }, + { + label: '内部-左', + value: 'inside-left' + }, + { + label: '顶部-右', + value: 'top-right' + }, + { + label: '顶部-左', + value: 'top-left' + }, + { + label: '底部-右', + value: 'bottom-right' + }, + { + label: '底部-左', + value: 'bottom-left' + } ] } diff --git a/src/packages/components/VChart/Bars/VChartBarCommon/config.ts b/src/packages/components/VChart/Bars/VChartBarCommon/config.ts index 1f035e86..c18ba01d 100644 --- a/src/packages/components/VChart/Bars/VChartBarCommon/config.ts +++ b/src/packages/components/VChart/Bars/VChartBarCommon/config.ts @@ -7,7 +7,7 @@ import axisThemeJson from '@/settings/vchartThemes/axis.theme.json' import { ChatCategoryEnum, IBarOption } from '../../index.d' import { merge, cloneDeep } from 'lodash' -export const includes = ['legends', 'tooltip'] +export const includes = ['legends', 'tooltip', 'label', 'bar'] export const option: IBarOption & { dataset?: any } = { // 图表配置 type: 'bar', diff --git a/src/packages/components/VChart/Bars/VChartBarCommon/config.vue b/src/packages/components/VChart/Bars/VChartBarCommon/config.vue index 9f15a51a..239a716c 100644 --- a/src/packages/components/VChart/Bars/VChartBarCommon/config.vue +++ b/src/packages/components/VChart/Bars/VChartBarCommon/config.vue @@ -3,11 +3,15 @@ + + + +