Highcharts Y-axis title text length is more than c

2019-09-11 00:43发布

问题:

I am working on highcharts. In my code, sometimes Y-axis title text is more than chart's height.

Ex. I am create one chart. In this chart, height is 400px but my Y-axis title text is long so some part of the text is not display. so what can i do?

see in jsfiddle

回答1:

You can set width on title and adapt margin.

yAxis: {
        title: {
            enabled: true,
            text: 'Custom with <b>simple</b> <i>markup</i>Custom with <b>simple</b> <i>markup</i>Custom with <b>simple</b> <i>markup</i>Custom with <b>simple</b> <i>markup</i>',
            margin: 40,
            style: {
                width: 200,
                fontWeight: 'normal'
            }
        }
    },

Example: http://jsfiddle.net/EUSVQ/12/