Gunnit
Gunnit

Reputation: 1074

Highcharts double y axis constant 0 value on both sides

Hello and thanks for reading.

I have a highchart whith 2 y-axis . I have different value s on both y-axis.

On one side i show a column graph with negative values and on the other a spline . I wanted to know how i can keep the 0 value on the same line when i have negative value's in my column chart.

What i mean is that when i have a negative value the 0 value is non at the same level as the 0 value on the other side and the chart dose not make much sense. How can i keep the 0 values constant at the same level.

Upvotes: 0

Views: 687

Answers (1)

Paweł Fus
Paweł Fus

Reputation: 45079

Example for you: http://jsfiddle.net/5m9JW/343/ Compare pixelPosition until setting extremes will get the same result.

 var i = 15;
 while (chart.yAxis[1].translate(0) != chart.yAxis[0].translate(0) && i > 0) {
    chart.yAxis[0].setExtremes(chart.yAxis[0].getExtremes().min - chart.yAxis[0].translate(chart.yAxis[1].translate(0), true));
    i--;
 };

Upvotes: 1

Related Questions