vue使用chart.js发现x轴过于拥挤,需要修改网格线的宽度,该如何做
scales: {
// x轴
xAxes: [
{
distribution: 'linear',
type: 'time',
time: {
displayFormats: this.timeFormat
},
ticks: {
autoSkip: false,
maxRotation: 0
},
gridLines: {
scaleStepWidth: 80
}
}
],
// y轴
yAxes: [
{
// 设置起止数据和步长
ticks: {
beginAtZero: true
}
}
]
}
}
this.chartLoading = true
},
是在gridLines里修改嘛
已自行解决,附代码