I want to make a chart which has percentage values on y-axis but I'm not able to find any options in document. Please suggest some answers
解决方案You could do something like this:
If you know the absolute value that represents 100% in your dataset, you can pass this to your options object:
scales: {
yAxes: [
{
ticks: {
min: 0,
max: this.max,// Your absolute max value
callback: function (value) {
return (value / this.max * 100).toFixed(0) + '%'; // convert it to percentage
},
},
scaleLabel: {
display: true,
labelString: 'Percentage',
},
},
],
},