UNPKG

1.76 kBMarkdownView Raw
1## jquery.flot.absRelTime.js
2
3This plugin is used to format the time axis in absolute time representation as
4well as relative time representation.
5
6It supports the following options:
7```js
8xaxis: {
9 timezone: null, // "browser" for local to the client or timezone for timezone-js
10 timeformat: null, // format string to use
11 twelveHourClock: false, // 12 or 24 time in time mode
12 monthNames: null // list of names of months
13}
14```
15
16Depending upon the timeformat axis parameter value, the axis tick formatter will
17choose between an absolute time representation if the value is '%A' or
18relative time for timeformat '%r'.
19
20If the format for an axis is 'time', inside processOptions hook the tickGenerator
21and tickFormatter of the axis will be overrided with the custom ones used by time axes.
22
23The formatted values look like in the example bellow:
24
25|format|value(s)|formatted value(s)|
26|------|----:|--------------:|
27|Absolute time|0|12:00:00 AM 1/1/0001|
28|Absolute time|300|12:05:00 AM 1/1/0001|
29|Relative Time|0, 300, 600|00:00:00, 00:05:00, 00:10:00|
30|Relative Time|300, 600, 900|00:00:00, 00:05:00, 00:10:00|
31
32### Relative time axis
33A relative time axis will show the time values with respect to the first data sample.
34Basically, the first datapoint from the points array will be considered time 00:00:00:00.
35If the difference between two datapoints is small, the milliseconds will apear.
36Otherwise, the time representation will contain only the hour, minute and second.
37
38### Absolute time axis
39The absolute time representation contains, beside the hours, minutes and seconds
40corresponding to the sample the date and year.
41The value will be splitted on two rows, where the first row is the time and
42the the second one the date in gregorian date format.