tarja
tarja

Reputation: 61

Highcharts datetime column chart - interval data

So I was wondering, is it possible, to show datetime values on x-axis as intervals.

For example, I have data that is saved to the database at 9:00, but if the hourly view of the data is chosen, that means that the data was collected from 8:00 to 9:00 and just saved at exactly 9:00. So when the column is rendered above the x-axis value 9:00, that is not true. It should be rendered on the 'category' 9:00 (from 8:00 to 9:00).

To sum up, I need something that would place that ONE column BETWEEN 8:00 and 9:00, or in general, between the given datetime value passed and the value that is one value less (before).

Is it possible to pass datetime intervals to a datetime axis?

Thanx for the help in advance!

Upvotes: 2

Views: 4998

Answers (2)

tarja
tarja

Reputation: 61

I found the answer. http://api.highcharts.com/highcharts#plotOptions.area.pointPlacement

The pointPlacement option set to "between" serves exactly this purpose.

I've scanned the Highchart Options Reference multiple times before, but must have missed it.

Upvotes: 1

jlbriggs
jlbriggs

Reputation: 17791

I would recommend using the pointRange option: http://api.highcharts.com/highcharts#plotOptions.column.pointRange

Using your example, if you set the data point to 8:30, and set a pointRange of 1 hour, it will span the block from 8:00 to 9:00

Upvotes: 0

Related Questions