設置圖表與div邊框的距離:
option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value',
},
grid:{
x:25, //x軸與div左邊框的距離
y:45, //y軸與div上邊框的距離
x2:5, //y軸末尾處於div右邊框的距離
y2:20, //y軸與div下邊框的距離
borderWidth:1
},
series: [{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: 'line',
}]
};