2

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!

tarja
  • 61
  • 1
  • 2
  • 8
  • Can you add a sample of your existing code to the question. have you read http://api.highcharts.com/highcharts#xAxis.dateTimeLabelFormats and http://stackoverflow.com/questions/7101464/how-to-get-highcharts-dates-in-the-x-axis – emeraldjava Mar 27 '13 at 10:10
  • If something like "%H:%M - %H+1:%M" would be possible, it could be a solution.. But I think you've misunderstood my problem. It is not so much as a problem what the label says, but where the column is placed. – tarja Mar 27 '13 at 10:35

2 Answers2

1

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.

tarja
  • 61
  • 1
  • 2
  • 8
0

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

jlbriggs
  • 17,612
  • 4
  • 35
  • 56