CR.4.1  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 Accessing Chart Data in Script in Chart Script Tutorial.

Tip: You can use the Chart's “query” prop­erty to set a query in the onLoad Handler. See Modifying a Chart Data Binding for an example.

You can assign the results of a runQuery() function to the Data object to set the chart dataset:

data = runQuery("sales by state");

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"]

See Also

Creating a Chart Using API Functions, for an example using runQuery().

DataSet, for information on setting the chart dataset.

Table, for information on accessing the dataset along with column headers.

<< CR.4 General Chart Properties © 1996-2013 InetSoft Technology Corporation (v11.5) CR.4.2 Table >>