series
  • 30 Oct 2020
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

series

  • Dark
    Light
  • PDF

Article summary

Description

Converts an array of moments 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

NameTypeRequiredDescription
arrayAnyYesArray of moments
[format]TextNoDateTime format specifier for labels

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.


DateTime Formats

Below is a collection of popular DateTime format value. Additional formatters are supported and can be found here.

FormatDescription
MMMMDecember (default)
MMMDec
MM12
MDecember 25
ddddTuesday
dddTue
dd25
d12/25/2019
yyyy2019
yy19
yDecember 2019
MM/dd/yyyy12/25/2019

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
var series = avatar.series(moments);

// render plot with locker token 'AAA' to insights panel
ai.insights.plot("plot1", true, "Testing", "AAA", series);

Remarks

Use this function when you want to plot moments returned from avatar.get via app.plot and ai.insights.plot.


What's Next