mirror of
https://github.com/dataease/dataease.git
synced 2026-06-16 20:42:07 +08:00
fix(图表): 修复柱条图轴线标签自动旋转
This commit is contained in:
@@ -600,13 +600,6 @@ export class Bar extends G2ChartView<ViewSpec, G2Column> {
|
||||
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<ViewSpec, G2Column> {
|
||||
...label,
|
||||
labelAutoHide: true,
|
||||
labelAutoRotate: false,
|
||||
...(rotate === 0 ? {} : { transform: [labelTransform] })
|
||||
labelTransform: `rotate(${axis.axisLabel.rotate || 0})`
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
@@ -330,11 +330,6 @@ export class BulletGraph extends G2ChartView<RuntimeOptions, G2Bullet> {
|
||||
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<RuntimeOptions, G2Bullet> {
|
||||
...grid,
|
||||
// 刻度值
|
||||
...label,
|
||||
transform: [labelTransform]
|
||||
labelTransform: `rotate(${axis.axisLabel.rotate || 0})`
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user