Phil Hannent
Phil Hannent

Reputation: 12317

How can I prevent my HighChart bar chart from being inverted?

For some odd reason the documentation for HighChart says that the bar chart is automatically inverted. I don't want this, does anybody have a work around?

Upvotes: 3

Views: 1799

Answers (6)

lk_vc
lk_vc

Reputation: 1172

Seems in the most recent version v4.2.3 it is false by default.

Upvotes: 0

陆同春
陆同春

Reputation: 9

i met the same problem with this , none of the answers helps , but i changed the source code of highcharts.js, pa = ka(wa, { type: "bar", inverted: !0 }); this place forced the charts for bar to be inverted , so i can only change the source code to remove the default behavior, like this pa = ka(wa, { type: "bar", inverted: 0 });

today i found i am so silly , just use "column" type ,"column" and "bar" are inverted

Upvotes: 1

Phil Hannent
Phil Hannent

Reputation: 12317

Turns out it was a question of terminology.

What I call a Gantt chart, is called a bar chart and what I call a bar chart they call a column chart. Problem solved.

Upvotes: 4

Will
Will

Reputation: 41

You can set the options so that Highcharts does not reverse the order of the series of the x-axis, therefore the axis are inverted but the bar series themselves are not inverted:

var chart = new Highcharts.Chart({
    ...
    xAxis: {
        reversed: false
        ...
    }
    ...
});

JSFiddle: http://jsfiddle.net/K5tpe/

Highcharts Documentation: http://api.highcharts.com/highcharts#xAxis.reversed

Upvotes: 2

Zaheer Ahmed
Zaheer Ahmed

Reputation: 28548

By default highchart set:

inverted: false

so you not need to worry, I you set it true then it will be inverted.

Upvotes: 0

Ash
Ash

Reputation: 2330

I think it's just poorly phrased documentation - "When true, the x axis is reversed by default" (my emph) It actually does what you'd expect by default! (i.e. the "by default" part of the sentence is very misleading!)

If you look at the sample code in jsFiddle via the "Try It" link in the documentation you'll see the line:

inverted: true

This setting is overriding the default behaviour, if you remove it and click run you'll see normal service resume!

Upvotes: 0

Related Questions