Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invert Y axis in Highcharts

Tags:

highcharts

Is there an option to invert the Y-axis in a Highcharts chart? For instance, if the axis would normally run from 0 at the bottom of the axis to 100 at the top, it should instead be shown running from 100 at the bottom to 0 at the top. This is useful, for instance, when using a chart with two Y-axis and you want to see the correlation between two lines with an inverse relationship.

Note that I'm not talking here about the inverted option in Highcharts, which just flips the position of the X and Y axes.

like image 829
Abiel Avatar asked Dec 28 '22 09:12

Abiel


1 Answers

Have you already examined the reversed option on the y-axis and the example from the api?

From the jsfiddle example because of stackoverflow's rule to include code when linking to jsfiddle:

},
yAxis: {
    reversed: true
},

This sounds like what you're looking for, but as an aside, you may want to re-consider dual-scaled axes.

like image 118
mg1075 Avatar answered Jan 22 '23 12:01

mg1075