jiawulin001 edited a comment on issue #16783:
URL: https://github.com/apache/echarts/issues/16783#issuecomment-1084264977
Both x axis and y axis is by default locked at zero of each other. Only
after you set `axis.axisLine.onZero` to `false` can you unlock and move it as
you wish.
<details>
<summary>Code Sample</summary>
```
option = {
legend: {
data: ['line11', 'line22']
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
animation: false
}
},
toolbox: {
show: true,
feature: {
dataZoom: {
// yAxisIndex: 'none'
},
dataView: { readOnly: false },
//magicType: {type: ['line']},
restore: {},
saveAsImage: {}
}
},
grid: {
top: 70,
bottom: 50
},
xAxis: [
{
type: 'value',
name: 'xAxisName111',
// scale: true
},
{
name: 'xAxisName222',
type: 'value'
}
],
yAxis: [
{
name: 'yAxisName1111',
type: 'value',
axisLine: {
onZero: false
}
},
{
name: 'yAxisName2222',
type: 'value',
axisLine: {
onZero: false
},
}
],
series: [
{
name: 'line11',
symbolSize: 5,
data: [
[-10, 4],
[1.1, 9],
[1.21, 18],
[1.32, 40],
[1.53, 71],
[1.74, 88],
[1.85, 55],
[1.96, 32],
[2.07, 9],
[2.38, 0.2]
],
type: 'line',
smooth: true,
showSymbol: false,
yAxisIndex: 0,
xAxisIndex: 0
// barGap: 0
},
{
name: 'line22',
symbolSize: 5,
yAxisIndex: 1,
xAxisIndex: 0,
data: [
[0.98, 1],
[1.3, 6],
[1.41, 27],
[1.62, 45],
[1.73, 77],
[1.84, 85],
[2.05, 47],
[2.16, 18],
[2.37, 6],
[2.38, 0.2]
],
type: 'line',
smooth: true,
showSymbol: false,
barGap: 0
}
]
};
```
</details>
@pissang @plainheart I think setting `axisLine.onZero` as true by default
would be sometimes very confusing, because it will make `axis.position` and
`axis.offset` completely dead before user find out there's a `onZero` locking
these options. I would suggest we at least clarify in documentation that user
should turn off `onZero` before they use `position` and `offset`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]