Description
Converts an array of JSON objects into a new array of JSON objects that represents a data series.
Data series arrays can be displayed in visual plots via app.plot and ai.insights.plot.
Input Parameters
| Name | Type | Required | Description | 
|---|---|---|---|
| array | Any | Yes | Array of JSON objects | 
| label | Text | Yes | Property name used for plot labels | 
| value | Text | Yes | Property name used for plot values | 
Returns
Type: Array (of JSON objects)
Returns a new array of JSON objects. Each object in the returned array will have two properties: label and value.
Examples
// get last 5 moments of vital sign identified by 12345
var moments = avatar.get("12345", "Vitals", 5);
// convert moments to data series for plotting
// note: moments always have 'time1' and 'value' properties
var series = tools.series(moments, "time1", "value");
// render plot with locker token 'AAA' to insights panel
ai.insights.plot("plot1", true, "Testing", "AAA", series);
Remarks
Use this function when you have an array of JSON objects that you want to convert into a data series for use elsewhere, such as with data visualization plots.
Data series arrays can be displayed in visual plots via app.plot and ai.insights.plot.
