我正在尝试设置我的条形图的 y 刻度,以便它每 20 次显示 0-100 之间的刻度。但是,它似乎不尊重我的选择。
我的选项是这样的:
this.options = {
scales: {
yAxis: [{
display: true,
ticks: {
beginAtZero: true,
min: 0,
max: 100,
stepSize: 20
}
}]
}
}
最佳答案
我认为是 Axes 而不是 Axis:
this.options = {
scales: {
yAxes: [{
display: true,
ticks: {
beginAtZero: true,
min: 0,
max: 100,
stepSize: 20
}
}]
}
}
关于javascript - chart.js v2 设置 y 刻度选项似乎被忽略了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37380115/