Displaying gateway graphs with 12hour time?

Started by CallOne_Phil, August 09, 2016, 11:32:54 PM

CallOne_Phil

I took a quick peek around the forum without any luck(unless I missed it) and was wondering if there is a setting to change how the gateway displays time.  I didn't notice anything in the gateway configuration files to change from 24 hour time to 12, so I assume it's a code edit somewhere in a javascript file?

-Phil

Felix

#1
Actually it's in the html file here.
This is how it's done for 24hrs:

<a class="graphControl" href="#" data-role="button" hours="24" data-icon="calendar" data-theme="b" title="last day">D</a>

CallOne_Phil

100% my fault for posting before bed and not being clear enough in my question.  I was referring to the time scale at the bottom of the graph and having it display 11am, 12pm, 1pm instead of 11:00, 12:00, 13:00.



Felix

#3
Ohh i see.
There are different formats you can use for the xaxis. But depending on the zoom level you might want different behavior.
The way it's done today is:

xaxis: { mode: "time", timezone: "browser", min:graphView.start, max:graphView.end},

Here's the documentation for the time series in the flot api. Also a stackoverflow topic about this.

FWIW I put it on my TODO to research how the xaxis can be changed according to zoom level and include it in a future version.

CallOne_Phil

I will checked into those docs and see how I make out.  Thanks for the speedy reply as always and keep up the great work you are doing on the gateway with these updates :)