From 369d3a03d199bfe451b87f2d1074ecf032a3e6dc Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Mon, 17 Nov 2025 16:41:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=9F=B1=E6=9D=A1=E5=9B=BE=E8=BD=B4=E7=BA=BF=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=97=8B=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chart/components/js/panel/charts/g2/bar/bar.ts | 9 +-------- .../components/js/panel/charts/g2/bar/bullet-graph.ts | 7 +------ .../components/js/panel/charts/g2/bar/horizontal-bar.ts | 9 +-------- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/bar.ts index 5ab9a6732a..55d28e7c30 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/bar.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/bar.ts @@ -600,13 +600,6 @@ export class Bar extends G2ChartView { return value } } - // 刻度值旋转角度 - const rotate = axis.axisLabel.rotate - const labelTransform = { - type: 'rotate', - optionalAngles: !rotate || rotate === 0 ? [] : [rotate], - recoverWhenFailed: false - } const x = { position: axis.position, // 标题 @@ -623,7 +616,7 @@ export class Bar extends G2ChartView { ...label, labelAutoHide: true, labelAutoRotate: false, - ...(rotate === 0 ? {} : { transform: [labelTransform] }) + labelTransform: `rotate(${axis.axisLabel.rotate || 0})` } return x } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/bullet-graph.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/bullet-graph.ts index 722c1ea0e9..1bcfe55c54 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/bullet-graph.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/bullet-graph.ts @@ -330,11 +330,6 @@ export class BulletGraph extends G2ChartView { return value } } - // 刻度值旋转角度 - const labelTransform = { - type: 'rotate', - optionalAngles: [axis.axisLabel.rotate] - } const x = { // 标题 title: axis.nameShow && axis.name ? axis.name : false, @@ -348,7 +343,7 @@ export class BulletGraph extends G2ChartView { ...grid, // 刻度值 ...label, - transform: [labelTransform] + labelTransform: `rotate(${axis.axisLabel.rotate || 0})` } return x } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/horizontal-bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/horizontal-bar.ts index 7e2ac1128a..4bbcf9097a 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/horizontal-bar.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/horizontal-bar.ts @@ -214,13 +214,6 @@ export class HorizontalBar extends Bar { return value } } - // 刻度值旋转角度 - const rotate = axis.axisLabel.rotate - const labelTransform = { - type: 'rotate', - optionalAngles: !rotate || rotate === 0 ? [] : [rotate], - recoverWhenFailed: false - } const x = { position: axis.position, // 标题 @@ -237,7 +230,7 @@ export class HorizontalBar extends Bar { ...label, labelAutoHide: true, labelAutoRotate: false, - ...(rotate === 0 ? {} : { transform: [labelTransform] }) + labelTransform: `rotate(${axis.axisLabel.rotate || 0})` } return x }