简体   繁体   中英

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.

图表截断

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM