From 36fcf837ae34125f06b031730d8c1b6a9a16079a Mon Sep 17 00:00:00 2001 From: wisonic Date: Thu, 26 Sep 2024 17:27:52 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E9=A5=BC?= =?UTF-8?q?=E5=9B=BE=E3=80=81=E7=8E=AB=E7=91=B0=E5=9B=BE=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E6=96=87=E6=A1=88=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/locales/zh-CN.ts | 3 ++- .../chart/components/editor/drag-label/QuotaLabel.vue | 2 +- .../chart/components/js/panel/charts/pie/common.ts | 2 +- .../chart/components/js/panel/charts/pie/rose.ts | 11 ++++++++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index e2cf7fa674..80ee010ff1 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -996,8 +996,9 @@ export default { drag_block_value_axis_left: '左值轴', drag_block_value_axis_right: '右值轴', drag_block_table_data_column: '数据列', - drag_block_pie_angel: '扇区角度', + drag_block_pie_angle: '扇区角度', drag_block_pie_label: '扇区标签', + drag_block_pie_radius: '扇区半径', drag_block_gauge_angel: '指针角度', drag_block_label_value: '值', drag_block_funnel_width: '漏斗层宽', diff --git a/core/core-frontend/src/views/chart/components/editor/drag-label/QuotaLabel.vue b/core/core-frontend/src/views/chart/components/editor/drag-label/QuotaLabel.vue index 89adf9a35f..ad4cc640c9 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-label/QuotaLabel.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-label/QuotaLabel.vue @@ -25,7 +25,7 @@ const props = defineProps({ >{{ t('chart.drag_block_value_axis') }} {{ - t('chart.drag_block_pie_angel') + t('chart.drag_block_pie_angle') }} {{ t('chart.drag_block_funnel_width') diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/pie/common.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/pie/common.ts index f328109dbd..ce8120c407 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/pie/common.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/pie/common.ts @@ -56,7 +56,7 @@ export const PIE_AXIS_CONFIG: AxisConfig = { type: 'd' }, yAxis: { - name: `${t('chart.drag_block_pie_label')} / ${t('chart.quota')}`, + name: `${t('chart.drag_block_pie_angle')} / ${t('chart.quota')}`, type: 'q', limit: 1 } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/pie/rose.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/pie/rose.ts index 288b22626b..87e4a95c7a 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/pie/rose.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/pie/rose.ts @@ -19,12 +19,21 @@ import { valueFormatter } from '@/views/chart/components/js/formatter' import { Datum } from '@antv/g2plot/esm/types/common' import { add } from 'mathjs' import isEmpty from 'lodash-es/isEmpty' +import { useI18n } from '@/hooks/web/useI18n' +const { t } = useI18n() export class Rose extends G2PlotChartView { axis: AxisType[] = PIE_AXIS_TYPE properties: EditorProperty[] = PIE_EDITOR_PROPERTY propertyInner: EditorPropertyInner = PIE_EDITOR_PROPERTY_INNER - axisConfig = PIE_AXIS_CONFIG + axisConfig: AxisConfig = { + ...PIE_AXIS_CONFIG, + yAxis: { + name: `${t('chart.drag_block_pie_radius')} / ${t('chart.quota')}`, + type: 'q', + limit: 1 + } + } async drawChart(drawOptions: G2PlotDrawOptions): Promise { const { chart, container, action } = drawOptions