Highcharts max interval for dateTime in x-axis?

highcharts, javascript

Solution

Highcharts will only show the last data point that is specified. If you want to force it to show the 0900 - 23:59 you will have to pass it all the data points for the those times you want displayed, but for the value pass null. Here is an example: jsfiddle example.

Once the data points go over the hour range it will automatically format the datatime labels differently. You may want to control the formatting of the data labels via dateTimeLabelFormats.

Problem

I have a daily graph, spanning across 00:00 to 23:59. but for live data, let's say currently is 9AM, by default it will stretch the graph from 00:00 - 09:00, which doesn't look nice to me. What I want is the x-axis max at 23:59 of the same day, so it will show 09:00 - 23:59 as blank. I tried `$graph["xAxis"]["max"] = (time()+86400)*1000` but without avail. any suggestion? thanks!

Original source