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