Dave Vronay
Dave Vronay

Reputation: 635

Specify xAxis values with columnRange chart in Highchart

I am using highchart, trying to make a chart that shows high and low values for the number of people occupying various rooms. So I have a data like this:

[[roomName, low, high], [roomName, low, high] ...]

For example:

["XRay", 12, 45], ["Waiting Room", 8, 22], ["Admitting", 22, 56]]

What I want to have happen is for the x Axis to use the room names as the values on the category axis. But I can't see to get this to happen. It uses them as the names of the points instead.

If I am just doing a column chart, I can set x and y properties for the points:

[x:"XRay", y:12], [x:"Waiting Room", y:8], [x:"Admitting", y:56]]

But I don't know how I can do this with column ranges.

I can of course manually parse the data and set the categories of the xAxis myself, but I am wondering if there is a better way.

Thanks!

Upvotes: 0

Views: 1458

Answers (1)

Paweł Fus
Paweł Fus

Reputation: 45079

It could be done in two ways, as suggested categories, or using label formatter, both are here: http://jsbin.com/oyudan/17/edit

Formats:

[ {x: 'string' } ... ] 

are not proper.

Upvotes: 2

Related Questions