data

The Chart data object is a two-dimensional array containing the aggregate data displayed on the Chart. You can use standard array notation, data[i][j], to access the data value in row i and column j. Use data.length and data.size, respectively, to obtain the number of X-axis labels and number of datasets. For an example, see Access Chart Data.

You can also use the Chart’s query property to set a query in onRefresh script . See Modify Chart Data Binding for an example.

You can assign the results of runQuery to the data object to set the Chart dataset:

data = runQuery("ws:global:Examples/AllSales");

The data object also supports formula table syntax such as the following:

// Data in aggregated measure/column 'Sum(Sales)'
data["Sum(Sales)"]

// Data in 'Sum(Sales)' for state of NJ
data["Sum(Sales)@State:NJ"]

// Data in 'Sum(Sales)' where the value exceeds 1000000
data["State?Sum(Sales) > 1000000"]