我正在尝试从以下位置迁移 Chart.js2.9.3
to 3.3.0
即使在应用更改之后(https://www.chartjs.org/docs/latest/getting-started/v3-migration.html https://www.chartjs.org/docs/latest/getting-started/v3-migration.html)我仍然收到错误:
Error: "category" is not a registered scale
.
这就是我所拥有的
Chart.register(BarController, DoughnutController, LineController, PieController);
new Chart(this.id, {
type: 'bar',
data,
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
title: {
display: options.plugins.title ? true : false,
},
tooltip: {
mode: 'index',
intersect: false
},
scales: {
x: {
stacked: true,
gridLines: {
drawBorder: false,
display: false,
},
ticks: {
autoSkip: true,
maxTicksLimit: 13,
},
},
y: {
stacked: true,
gridLines: {
color: '#e6e6e6',
drawBorder: false,
},
}
}
});
我在这里可能会缺少什么?