你可以设置grid选项可以实现这个目标:
grid.containLabel = true
Run Code Online (Sandbox Code Playgroud)
如果你愿意,还可以设置:
grid.bottom = 0
Run Code Online (Sandbox Code Playgroud)
例如:
option = {
xAxis: {
type: 'category',
axisLabel: {
interval: 1,
rotate: 45
},
data: ['2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04']
},
yAxis: {
type: 'value'
},
grid: {
bottom: 0,
containLabel: true
},
series: [{
data: [820, 932, 901, 934, 1290, 1330, 1320, 820, 932, 901, 934, 1290, 1330, 1320, 820, 932, 901, 934, 1290, 1330, 1320, 820, 932, 901, 934, 1290, 1330, 1320,820, 932, 901, 934, 1290, 1330, 1320],
type: 'line',
smooth: true
}]
};
Run Code Online (Sandbox Code Playgroud)