Whitecat Whitecat - 1 year ago 155
Javascript Question

How to stop axis label from being cut off in chart JS?

How do I stop the chart from cutting off the axis label words? This question is similar: "How do I prevent the scale labels from being cut off in chartjs?" But only addresses the labels on the tick marks.

The axis label should say "mental health continuum". But the

m
is cut off.

Chart cut off

Answer Source

You can fix that by setting the layout padding on the chart.

options: {
  layout: {
    padding: {
      top: 20
    }
  }
}

Here is the reference http://www.chartjs.org/docs/latest/configuration/layout.html

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download