laloune
Posts: 23
Joined: Thu Aug 28, 2014 10:10 pm

Offset of bar series

Hello all,

I digged up an old chart that was provided on this very same forum (3 or 4 years ago):

http://jsfiddle.net/3jwc18ah/

I try to use percentages to split the chart, e.g. 30% for the upper part, and the rest to70% (or automatic if possible) ; it seems to work, but the bar series on the lower part is offset... Is it possible to make it stick to the x-axis ?

Thanks in advance for your support!

best
laloune
magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: Offset of bar series

Hi,

Thanks for contacting us with your question!

You can easily change it by adding yAxis.top property set to the height value of the first yAxis. So, in your case:

Code: Select all

  yAxis: [
    height: '30%',
  }, 
    height: '70%',
    top: '30%',
    offset: 0,
  }],

As you can see at your previous demo, also first yAxis was shifted slightly to the right. You can prevent it by adding offset to 0 to the second yAxis.

Demo:
http://jsfiddle.net/BlackLabel/ebL60oax/

Let me know if you have any further questions,
Regards!
Magdalena Gut
Developer and Highcharts Support Engineer
laloune
Posts: 23
Joined: Thu Aug 28, 2014 10:10 pm

Re: Offset of bar series

hello Magdalena,

thanks a ton! this works perfectly!
magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: Offset of bar series

That's great to hear! In case of any further questions, feel free to contact us again.
Magdalena Gut
Developer and Highcharts Support Engineer

Return to “Highcharts Usage”