0👍
Add label title to either of the axes like so:
const options = {
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: 'label for Y'
}
},
x: {
beginAtZero: true,
title: {
display: true,
text: 'label for X'
}
},
},
};
the text property is the text label to be displayed on the axes. ‘options’ variable is what you pass to the options prop.
- Chartjs-Why chart.js doesn't show result in Bootstrap block
- Chartjs-How do I destroy/update Chart Data in this chart.js code example?
Source:stackexchange.com