如何使 y 轴上的零与 x 轴上的标签处于同一水平。
我已经尝试了 chartjs 文档中的几乎所有内容,但似乎没有任何效果
这是我的配置对象:
var config = {
type: 'line',
options: {
responsive: true,
maintainAspectRatio: false,
legend: { display: false },
scales: {
xAxes: [{
gridLines: {
drawBorder: false,
color: "#EEEEEE",
beginAtZero: false,
zeroLineColor: 'transparent'
},
ticks: {
fontColor: "#9A9A9A",
fontStyle: '600',
fontSize: 15
}
}],
yAxes: [
{
gridLines: {
color: "#EEEEEE",
beginAtZero: false,
zeroLineColor: 'transparent',
drawBorder: false
},
ticks: {
max: 30,
min: 0,
stepSize: 5,
fontColor: "#9A9A9A",
fontStyle: '505',
fontSize: 14
}
},
]
}
},
data: {
labels: ["", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
datasets: [{
data: [null, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
showLine: true,
lineTension: 0,
fill: false,
pointRadius: 4,
borderWidth: 2,
pointBackgroundColor: "#FFFFFF",
backgroundColor: "transparent",
borderColor: "#973490"
}]
}
};