Accepted answer you can see on the left i have a strange 0.150000000000000000000002 value

the original axis label function had code to round the label to the number of decimal points in the stepvalue. i couldn't see it in the new one. however you can easily fix it by changing the template string

labels: {
    template: "<%= number(value.tofixed(2)) + ' a'%>",

or by replacing it with a callback function to format the number as you wish

labels: {
    usercallback: function (tick) {
        return number(tick.tofixed(2)) + ' a';
    }, y-axis labels are cutted

there is already a bug logged for this - and it's part of the 2.0 milestone. so it should be fixed before the final 2.0 release.

till then you can easily work around it by adding some top padding to the canvas parent (and styling the wrapper instead of the canvas - background-color, border...)

fiddle -


i ran into the same problem with version: 2.1.6.

potatopeelings' updated solution looks like this:

    var options = {
        scales: {
            yaxes: [{
                ticks: {
                    callback: function (value, index, values) {
                        return parsefloat(value).tofixed(2) + '%';

Related Query

More Query from same tag