Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to invert a chart in Highcharts through code?

I am trying to invert a chart through code in Highcharts.

I am setting the chart inverted property:

chart.inverted = true;
chart.redraw();

You can see the code I am using here:

http://jsfiddle.net/Wajood/Hz4bH/

This doesn't invert the chart. It seems to me that the redraw() function doesn't seem to care for the inverted property.

Any help/suggestions/tips in the matter will be appreciated.

Thanks.

like image 474
aspnet learner Avatar asked Jan 27 '13 13:01

aspnet learner


1 Answers

Calling redraw() will only redraw data changes. Browsing the methods in the Highcharts API there does not appear to be a method which will change the inverted setting of an existing chart.

Your only option in this case is to destroy the existing chart and create a new one with the relevant chart.inverted setting.

like image 86
Rory McCrossan Avatar answered Sep 23 '22 18:09

Rory McCrossan