From c1e119f231c40817bbea4e083db525b8a4bf5be2 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Thu, 10 Apr 2025 14:04:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=B1=A1=E9=99=90=E5=9B=BE=E9=9A=90=E8=97=8F=E7=BA=B5=E8=BD=B4?= =?UTF-8?q?=E8=BD=B4=E5=90=8D=E7=A7=B0=E5=90=8E=EF=BC=8C=E6=95=B4=E4=B8=AA?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E9=83=BD=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20#15628?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/js/panel/charts/others/quadrant.ts | 5 +++-- .../views/chart/components/js/panel/common/common_antv.ts | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/quadrant.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/quadrant.ts index 3162c22a53..a4b539e5da 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/quadrant.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/quadrant.ts @@ -13,7 +13,8 @@ import { configPlotTooltipEvent, configYaxisTitleLengthLimit, getTooltipContainer, - TOOLTIP_TPL + TOOLTIP_TPL, + getPadding } from '../../common/common_antv' import { DEFAULT_LEGEND_STYLE } from '@/views/chart/components/editor/util/chart' @@ -209,7 +210,7 @@ export class Quadrant extends G2PlotChartView { data: data, xField: 'yAxis', yField: 'yAxisExt', - appendPadding: 30, + appendPadding: getPadding(chart), pointStyle: { fillOpacity: 0.8, stroke: '#bbb' diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts index 266cdd260a..4544cb7b14 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts @@ -2098,10 +2098,12 @@ export function configYaxisTitleLengthLimit(chart, plot) { ? wrappedTitle.slice(0, wrappedTitle.length - 2) + '...' : wrappedTitle + '...' } - // 更新Y轴标题的原始文本和截断后的文本 - ev.view.options.axes.yAxisExt.title.originalText = yAxis.name - ev.view.options.axes.yAxisExt.title.text = wrappedTitle + const { title } = ev.view.options.axes.yAxisExt + if (title) { + title.originalText = yAxis.name + title.text = wrappedTitle + } }) }