From 2f1e757df376892f5bd385f5900a5d7a438b3dba Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Sat, 9 May 2026 17:12:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=83=AD=E5=8A=9B=E5=9B=BE=E6=8B=96=E5=8A=A8legend=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E6=9C=80=E5=80=BC=E8=89=B2=E5=9D=97=E6=A6=82=E7=8E=87?= =?UTF-8?q?=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/js/panel/charts/g2/table/t-heatmap.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/table/t-heatmap.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/table/t-heatmap.ts index 0fcaa53267..afedee83c6 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/table/t-heatmap.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/table/t-heatmap.ts @@ -242,8 +242,13 @@ export class TableG2Chart extends G2ChartView { scale: { color: { type: 'linear', + nice: true, interpolate() { - return c => colors[Math.floor(c * (colors.length - 1))] + return c => { + if (isNaN(c)) return colors[0] + const t = Math.max(0, Math.min(1, c)) + return colors[Math.floor(t * (colors.length - 1))] + } } } } @@ -272,8 +277,7 @@ export class TableG2Chart extends G2ChartView { legend: { color: { color: colors, - label: false, - step: 0.00000001 + label: false } } }