图示:
option:
option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
offset: 40
},
yAxis: {
type: 'value',
offset: 30,
axisLine:{
show:true
}
},
series: [{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: 'line',
smooth: true
}]
};
问题:
同样是设置了offset,x轴线没动,是标签动,而y轴就是轴线都动了,这是怎么回事?echarts本来就这样的吗?
官方文档描述:
xAxis. offset--
X 轴相对于默认位置的偏移,在相同的 position 上有多个 X 轴的时候有用。
yAxis. offset--
Y 轴相对于默认位置的偏移,在相同的 position 上有多个 Y 轴的时候有用。
在线调试链接:
https://echarts.apache.org/ex...
已经解决
使用offset属性,轴线理应是动的,但--
X默认这个属性为true,因此x轴线不动。
要想设置坐标轴标签和坐标轴线二者的间距,可以设置axisLabel.margin