0

I'm trying to add extra padding to my chart (extra space at the right of the "orange" column):

But using chart 3.7.0 doesn't seem to work, any idea of how I can achieve this??

chart.options.scales:

scales: {
    x: {
        afterFit(axis) {
            axis.paddingLeft = 50; //doesn't work
            axis.paddingRight = 50; //doesn't work
        },
    },
},

Full Runnable example.

Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220

1 Answers1

0

Chart.js docs state following

let chart = new Chart(ctx, {
    type: 'line',
    data: data,
    options: {
        layout: {
            padding: {
                right: 50
            }
        }
    }
});