Highcharts x axis label text wrapping lost on setting label step

后端 未结 2 1783
情书的邮戳
情书的邮戳 2021-01-22 16:03

I have a problem with the Highcharts label wrapping on the X axis .It is lost on setting the label step property as shown in the links below

Correct: http://jsfiddle.ne

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-22 16:39

    It's a bit of a hack, but you could replace each space in the name with
    by using the formatter:

    labels: {
        step: 1,
        formatter: function () {
            return this.value.replace(/ /g, '
    '); } }

    It's not exactly what you want as it doesn't split the name according to the space available between ticks, but maybe you can improve the formatter to better suit your needs (splitting by a given n characters for example instead of by space).

    See it running here.

提交回复
热议问题