render_json
The render_json function is used to get a chart’s JSON.
svc=report/render_json¶ms={"attachmentIndex":<uint>,
"width":<uint>,
"useCrop":<uint>,
"cropBegin":<uint>,
"cropEnd":<uint>}
Parameters
Name | Description |
---|---|
attachmentIndex | Attachment index. |
width | According to this parameter, the optimum number of pixels for the chart is returned. |
useCrop | Сrop the time interval:
|
cropBegin | The beginning of the interval, Unix time. |
cropEnd | The end of the interval, Unix time. |
Returned result
The following fields are only available in Wialon Hosting and Wialon Local 2204: units, mmi, interruptions, possitions.
{
"datasets":{ /* data */
"<text>":{ /* chart index */
"name":"<text>", /* chart name */
"color":<uint>, /* line colour */
"y_axis":<uint>, /* use the second Y-axis (for the charts with two curves and different measurements): 0 — no, 1 — yes */
"units": "<text>", /* chart units of measurement by the Y-axis; null if the chart values have no units of measurement */
"data": {
"x": [
<uint>, /* chart trace (time) */
...
],
"y": [ /* chart trace (value) */
<int>,
...
]
},
"colors": [ /* chart colour intervals */
[<uint>, /* interval start time */
<uint>], /* colour */
...
],
},
...
},
"mmi":[<uint>], /* the array of values by the X-axis from the raw dataset, the interval between which is longer than the indicated time (dt) > "Maximum interval between messages" */
"interruptions":[<uint>], /* the array of values by the X-axis from the filtered dataset, the interval between which is longer than the indicated time (dt) > "Maximum interval between messages" */
"markers":[ /* markers */
{
"type":<uint>, /* type */
"x": [
<uint>, /* time */
...
]
},
...
],
"background_regions": [ /* background intervals */
{
"name":"<text>", /* name */
"color":<uint>, /* colour */
"priority":<uint>, /* priority */
"regions":[
[<uint>, /* the beginning of the interval */
<uint> /* the end of the interval */
],
...
]
},
...
],
"possitions":{ /* the values of the coordinates of the returned points of all the lines in the chart */
"time":[<uint>],
"lat":[<double>],
"lon":[<double>]
}
}
Marker flags:
HEX flag | DEC flag | Description |
---|---|---|
0x4 | 4 | Event/Violation. |
0x8 | 8 | Fuel filling. |
0x10 | 16 | Image. |
0x20 | 32 | Parking. |
0x40 | 64 | Speeding. |
0x80 | 128 | Stop. |
0x100 | 256 | Fuel drain. |
0x800 | 2048 | Video. |
0x1000 | 4096 | Violation. |
Possible error codes:
Code | Description |
---|---|
6 | Failed to fetch user. |
5 | Report file reading/writing error. |
4 | Wrong input parameters. |