From 90fac24bcbb63a321f89dc73b068d537de5fa395 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Tue, 3 Dec 2024 10:23:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E7=83=AD=E5=8A=9B?= =?UTF-8?q?=E5=9B=BE=E7=BA=B5=E8=BD=B4=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/js/panel/charts/table/t-heatmap.ts | 12 +++++++++++- .../chart/components/js/panel/common/common_antv.ts | 10 ++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/t-heatmap.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/t-heatmap.ts index 2b6506a28c..f8e9253ab4 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/t-heatmap.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/t-heatmap.ts @@ -8,6 +8,7 @@ import { useI18n } from '@/hooks/web/useI18n' import { deepCopy } from '@/utils/utils' import { cloneDeep } from 'lodash-es' import { + configAxisLabelLengthLimit, getPadding, getXAxis, getYAxis @@ -38,7 +39,15 @@ export class TableHeatmap extends G2PlotChartView { 'basic-style-selector': ['colors'], 'label-selector': ['fontSize', 'color'], 'x-axis-selector': ['name', 'color', 'fontSize', 'position', 'axisLabel', 'axisLine'], - 'y-axis-selector': ['name', 'color', 'fontSize', 'position', 'axisLabel', 'axisLine'], + 'y-axis-selector': [ + 'name', + 'color', + 'fontSize', + 'position', + 'axisLabel', + 'axisLine', + 'showLengthLimit' + ], 'title-selector': [ 'title', 'fontSize', @@ -194,6 +203,7 @@ export class TableHeatmap extends G2PlotChartView { } } }) + configAxisLabelLengthLimit(chart, newChart) return newChart } 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 c9cbcef083..21d57ee6f4 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 @@ -1438,8 +1438,11 @@ export function configAxisLabelLengthLimit(chart, plot) { } plot.on('axis-label:mouseenter', e => { const field = e.target.cfg.delegateObject.component.cfg.field + // 不分图表纵轴通过位置判断,左右为纵轴,目前仅热力图 + const position = e.target.cfg.delegateObject.component.cfg.position + const isYaxis = position === 'left' || position === 'right' // 先只处理竖轴 - if (field !== 'field' && field !== 'title') { + if (field !== 'field' && field !== 'title' && !isYaxis) { return } const realContent = e.target.attrs.text @@ -1482,8 +1485,11 @@ export function configAxisLabelLengthLimit(chart, plot) { }) plot.on('axis-label:mouseleave', e => { const field = e.target.cfg.delegateObject.component.cfg.field + // 不分图表纵轴通过位置判断,左右为纵轴,目前仅热力图 + const position = e.target.cfg.delegateObject.component.cfg.position + const isYaxis = position === 'left' || position === 'right' // 先只处理竖轴 - if (field !== 'field' && field !== 'title') { + if (field !== 'field' && field !== 'title' && !isYaxis) { return } const realContent = e.target.attrs.text