insights.plot
  • 30 Oct 2020
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

insights.plot

  • Dark
    Light
  • PDF

Article summary

Description

Renders a plot visualization insight that persists for the lifetime of an app.


Input Parameters

NameTypeRequiredDescription
keyTextYesUnique identifier for plot
onBooleanYesVisibility toggle (true = show, false = hide)
[category]TextNoCategory to group plot within
[lockerToken]TextNoPlot's locker token
[data1]ArrayNoPlot's required 1st data series
[data2]ArrayNoPlot's optional 2nd data series
[data3]ArrayNoPlot's optional 3rd data series
[data4]ArrayNoPlot's optional 4th data series
[data5]ArrayNoPlot's optional 5th data series
[data6]ArrayNoPlot's optional 6th data series
[data7]ArrayNoPlot's optional 7th data series
[data8]ArrayNoPlot's optional 8th data series
[data9]ArrayNoPlot's optional 9th data series
[data10]ArrayNoPlot's optional 10th data series

Returns

No return value.


Examples

// 1 series plot example...
// prepare plot data
var series = [10, 25, -30, 50, -15];

// render plot with locker token 'AAA' to insights panel
ai.insights.plot("plot1", true, "Testing", "AAA", series);
// 3 series plot example...
// prepare plot data
var series1 = [10, 25, -30, 50, -15];
var series2 = [22, 54, 38.45, -18, -65];
var series3 = [32.64, 81, 104, -45.3, -12];

// render plot with token 'AAA' to insights panel
ai.insights.plot("plot1", true, "Testing", "AAA", series1, series2, series3);
// hide (remove) a plot from insights panel
ai.insights.plot("plot1", false);

Remarks

Plots are graphical visualizations of data prepared by your scripts. The configuration of each plot, along with any sample data, is developed using Symmetry Pro and stored in your app's locker.

When your script runs, this function will replace the sample data in your plot's configuration with the provided series data. Up to 10 data series are currently supported.


What's Next