Vue-chartjs: Custome label y axis

Created on 16 Jul 2017  ยท  2Comments  ยท  Source: apertureless/vue-chartjs

Expected Behavior

Hi sir, i want to ask is it possible to custom scales yAxis ticks label?

Actual Behavior

.....
ummm, if I want the scales yAxis ticks to be a value with percentage or dollar $. Is it possible?

many thank you, sir

โ“ question

Most helpful comment

Yes tried that by inserting this option inside your yAxes.

ticks: {
   callback: function(label, index, labels) {
     return '$'+label/1000; // just change the '$' to % for percentage
   }
}

All 2 comments

Yes tried that by inserting this option inside your yAxes.

ticks: {
   callback: function(label, index, labels) {
     return '$'+label/1000; // just change the '$' to % for percentage
   }
}

Yep like @claide said,
you have to create a custom callback for the xAxis ticks in your options object and pass it.

http://www.chartjs.org/docs/latest/axes/labelling.html#creating-custom-tick-formats

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timster picture timster  ยท  5Comments

Sykomaniac picture Sykomaniac  ยท  3Comments

sergeynilov picture sergeynilov  ยท  3Comments

egorzekov picture egorzekov  ยท  4Comments

sylvaincaillot picture sylvaincaillot  ยท  3Comments