plot

Prev Next

Description

Renders a plot visualization to a specified Picture app object.


Input Parameters

Name Type Required Description
tokenOrName Text Yes Picture app object token or name
lockerToken Text Yes Plot's locker token
width Number Yes Display pixel width (height will auto-scale)
data1 Array Yes Plot's required 1st data series
[data2] Array No Plot's optional 2nd data series
[data3] Array No Plot's optional 3rd data series
[data4] Array No Plot's optional 4th data series
[data5] Array No Plot's optional 5th data series
[data6] Array No Plot's optional 6th data series
[data7] Array No Plot's optional 7th data series
[data8] Array No Plot's optional 8th data series
[data9] Array No Plot's optional 9th data series
[data10] Array No Plot's optional 10th data series

Returns

No return value.


Examples

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

// render plot with token 'AAA' to picture object '[20]'
// width of plot will be 200 pixels; height adjusted to scale
app.plot("[20]", "AAA", 200, data);
JavaScript
// 3 series plot example...
// prepare plot data
var data1 = [10, 25, -30, 50, -15];
var data2 = [22, 54, 38.45, -18, -65];
var data3 = [32.64, 81, 104, -45.3, -12];

// render plot with token 'AAA' to picture object '[20]'
// width of plot will be 200 pixels; height adjusted to scale
app.plot("[20]", "AAA", 200, data1, data2, data3);
JavaScript

Remarks

Plots are graphical visualizations of data prepared by your scripts. The configuration of each plot, along with any sample data, is developed using Composer 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.

You only need to specify the plot's width (in pixels) for rendering. The runtime will ensure the height is scaled appropriately to preserve the plot's native aspect ratio so the plot does not appear distorted.