Skip to content

Line chart with multiple Y axies and multiple bottom X axies may causes X axies offset error.(当有双x轴双y轴时,第二条x轴轴体偏移失效) #14455

@dingbowen163

Description

@dingbowen163

Version

5.0.2

Steps to reproduce

1.Set 2 Y axies.
2.Set 2 X axies,second of xAxies set
{ position: 'bottom',
offset: 40
}

Example option code:
option = {
legend: {
data: ['蒸发量', '降水量', '平均温度']
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: ['1月', '2月', '3月', '4月', '5月']
},{
type: 'category',
position: 'bottom',
offset: 40,
show: true,
data: ['31天', '28天', '31天', '30天']
}
],
yAxis: [
{
type: 'value',
name: '蒸发量',
min: 0,
max: 250,
position: 'right',
axisLine: {
show: true,
lineStyle: {
color: colors[0]
}
},
axisLabel: {
formatter: '{value} ml'
}
},
{
type: 'value',
name: '温度',
min: 0,
max: 25,
position: 'left',
axisLine: {
show: true,
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: '{value} °C'
}
}
],
series: [
{
name: '蒸发量',
type: 'line',
data: [2.0, 4.9, 7.0, 23.2, 25.6]
},
{
name: '平均温度',
type: 'line',
yAxisIndex: 1,
data: [2.0, 2.2, 3.3, 4.5, 6.3]
}
]
};

What is expected?

The second xAxis offset 40px.

What is actually happening?

Only the label of the second xAxis offsets. The line of xAxis not offset. The two xAxies coincide.


some background/context of how I ran into this bug:
Statistic gap time between 2 xAxis node.

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.waiting-for: community

    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