refactor(图表): 饼图、玫瑰图指标文案修改

This commit is contained in:
wisonic 2024-09-26 17:27:52 +08:00
parent d6677aa922
commit 36fcf837ae
4 changed files with 14 additions and 4 deletions

View File

@ -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: '漏斗层宽',

View File

@ -25,7 +25,7 @@ const props = defineProps({
>{{ t('chart.drag_block_value_axis') }}</span
>
<span v-else-if="props.view.type && props.view.type.includes('pie')">{{
t('chart.drag_block_pie_angel')
t('chart.drag_block_pie_angle')
}}</span>
<span v-else-if="props.view.type && props.view.type.includes('funnel')">{{
t('chart.drag_block_funnel_width')

View File

@ -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
}

View File

@ -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<RoseOptions, G2Rose> {
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<G2Rose>): Promise<G2Rose> {
const { chart, container, action } = drawOptions