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 }