Highstock/Highchart Y axis label names breaking on multiple lines in timeseries chart

34 views Asked by At

Time series chart

[![enter image description here]

I have this chart plotted and as we can see the y axis label names are appearing in multiple lines. There are 3 columns selected in Y AXIS. Is there a way where we can display them each in one line

1

There are 1 answers

0
ppotaczek On

You can set width style for y-axis title and position it in the render event callback. For example:

  chart: {
    height: 230,
    events: {
      render: function() {
        this.yAxis[0].axisTitle.attr({
          y: 115
        });
      }
    }
  },
  yAxis: {
    title: {
      text: '30 Days Active Users 60 Days Active Users 90 Days Active Users',
      style: {
        width: 230
      }
    },
    opposite: false
  }

Live demo: https://jsfiddle.net/BlackLabel/q1sykznu/

API Reference: https://api.highcharts.com/highcharts/yAxis.title