Skip to content

[Bug] X轴文字同时开启旋转和换行的时候,显示错位 #17307

@pingbaobao

Description

@pingbaobao

Version

5.3.3

Link to Minimal Reproduction

No response

Steps to Reproduce

option = {
xAxis: {
type: 'category',
data: ['2022-02月推广活动', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisLabel: {
rotate: -45, // 旋转
formatter: function (val) {
return '20\n22\n-0\n2月推\n广活\n动';
},
},
},
yAxis: {
type: 'value'
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar',
showBackground: true,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
}
}
]
};

Current Behavior

image
Xzho轴文字当同时旋转和换行时,位置会向上偏移

Expected Behavior

能够正确计算出X轴文字的位置,旋转时正确的方向

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpendingWe are not sure about whether this is a bug/new feature.staleInactive for a long time. Will be closed in 7 days.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions