2👍
If you want to change just the tick labels use the callback
property of ticks
. For example
...
options: {
scales: {
yAxes: [{
ticks: {
callback: function(value) {
if (value === 20)
return 'Low';
else if (value === 50)
return 'Medium';
else if (value === 80)
return 'High';
else
return '';
}
}
}]
}
}
Fiddle – http://jsfiddle.net/1gfu0tfg/
- [Chartjs]-Ng2-charts customize data and whole html content of tooltip displayed when hovering on bar chart
- [Chartjs]-Chart is too big. How can I reduce size for the chart in vue js?
Source:stackexchange.com