chrysb
Posts: 4
Joined: Wed Dec 15, 2021 11:17 pm

Multiple y-axes, one set of labels

I'm want to create a column chart that looks like this:

Image

When I'm trying to implement it, the labels are in two separate columns. Is there a setting for this?

Image

Here's my axis code:

Code: Select all

      yAxis: [
        {
          height: '50%',
          title: { enabled: false },
          labels: {
            allowOverlap: true,
          },
        },
        {
          height: '50%',
          top: '50%',
          reversed: true,
          title: { enabled: false },
          labels: {
            allowOverlap: true,
          },
        },
      ],
chrysb
Posts: 4
Joined: Wed Dec 15, 2021 11:17 pm

Re: Multiple y-axes, one set of labels

I was able to accomplish this by setting `offset` to 0 on both yAxes
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Multiple y-axes, one set of labels

Hi there,

Thank you for contacting us. What you have observed is the default behavior of the Highcharts. Whenever you add multiple axes, they get a different offset to avoid overlapping. Setting it to 0 positions them in the same place - so your solution is absolutely fine! Thank you for sharing it with other forum users.

You can read about it more here: https://api.highcharts.com/highcharts/yAxis.offset

Do not hesitate to contact us with any further questions!
Have a good day
Kamil Musiałowski
Highcharts Developer

Return to “Highcharts Usage”