kdphelan
Posts: 5
Joined: Mon Apr 17, 2023 6:45 pm

Dual y-Axis Series Overlaps 0

I am trying to create a chart with a dual y-axis with a column series and a line series. My problem is that the column series appears to overlap the 0 axis line even when it shouldn't, has anyone seen anything like this before? I'm sure I probably configured something incorrectly. Any help would be appreciated.

https://jsfiddle.net/kdphelan/nag6u4yo/5/
jakub.j
Posts: 1091
Joined: Tue Jan 24, 2023 11:14 am

Re: Dual y-Axis Series Overlaps 0

Welcome to our forum and thanks for contacting us with your question!

If you want the line series to be on top of the column, simply set it's series.index to a higher value.
I prepared a demo using series.index to show you, how it can be done, I also temporarily changed the line series color to have better visibility.

Demo: https://jsfiddle.net/BlackLabel/cg09w7e8/

Feel free to ask any further questions!
Regards
Jakub
kdphelan
Posts: 5
Joined: Mon Apr 17, 2023 6:45 pm

Re: Dual y-Axis Series Overlaps 0

No, that's not exactly what I mean. The column series data points appear to start below the 0 axis rather than on the 0 axis, that is the issue I am having.
jakub.j
Posts: 1091
Joined: Tue Jan 24, 2023 11:14 am

Re: Dual y-Axis Series Overlaps 0

Hey,

Okey, I misunderstood your question.
As some of your column data is negative You can set yAxis.min to 0 and yAxis.startOnTick to false for both yAxis to hide values below 0 but I'm still not sure if that is what you were looking for.

Demo: https://jsfiddle.net/BlackLabel/tng17db4/
If that doesn't work for you, please describe it with more details, what behaviour you actually want.

Best regards
Jakub
kdphelan
Posts: 5
Joined: Mon Apr 17, 2023 6:45 pm

Re: Dual y-Axis Series Overlaps 0

Not exactly, some of the column series data could be negative so I can't hide below 0, however some of the column datapoints are spanning above and below the 0 axis line despite the fact that it is a positive number.
jakub.j
Posts: 1091
Joined: Tue Jan 24, 2023 11:14 am

Re: Dual y-Axis Series Overlaps 0

I'm sorry but I don't understand what you mean at all.
Could you please visualize this somehow, or describe precisely what do you want to achieve?

Maybe this will help, because you add two points with the same x value (one with y>0 and one with y<0) I colored the values below 0 with red and the other above 0 are black. So those two points are on the same column.

Demo: https://jsfiddle.net/BlackLabel/3569ufac/

Best regards
Jakub

Return to “Highcharts Stock”