0👍
There is a wrong chart configuration.
The scales are defined inside the "plugins" node and that’s not correct.
Move the scales in the chart options:
const options = {
responsive: true,
scales: {
x: {
type: "category",
labels: ["apple", "banana", "coconut"],
ticks: {
display: true
},
grid: {
display: false
}
},
y: {
type: "category",
labels: ["fruit", "juice", "smoothie"],
offset: true,
ticks: {
display: true
},
grid: {
display: false
}
}
},
plugins: {
title: {
display: true,
text: "fruits"
},
}
};
- Chartjs-How to sum value by month and assign two different variables?
- Chartjs-Thymeleaf th:each rendering a chart js bar chart in each loop
Source:stackexchange.com