0👍
Without seeing the chart’s configuration, I would suggest to hide only the y-axis tick labels instead of the entire y-axis:
options: {
scales: {
yAxes: [{
ticks: {
display: false
}
}]
}
}
Another solution could be to add a suggestedMax
property to the y-axis. Use Math.max()
or any other function to get the maximum y
value you’re going to receive and then pass this value to suggestedMax
:
options: {
scales: {
yAxes: {
suggestedMax: 5
}
}
}
Anyway if you could post your chart’s configuration it would be helpful.
- Chartjs-Customization of Data Labels in doughnut chart ng2-charts
- Chartjs-LWC: How to display data values in chart js bars in Lightning Web Components(LwC) salesforce
Source:stackexchange.com