CR.4.3  DataSet

The DataSet object allows you to set the values to be displayed on the graph. It has the form of a two-dimensional array, where each column represents a distinct measure. You can specify the DataSet by one of the following methods:

In Style Studio or Visual Composer, set the chart binding using the Chart Editor.

In report or Viewsheet script, assign a JavaScript array to the dataset property.

dataset = [["State", "Quantity"],["NJ", 200],["NY", 300],["PA", 370],["CT", 75]];

See Running a Query from Script in Dash­board Scripting and Running a Query from Script in Report Script­ing for details about runQuery().

In report or Viewsheet script, assign a query result (e.g., 'sales by state') to the dataset property.

dataset = runQuery("sales by state");

The DataSet object is also accessible for reading. See the getData() method for more information. However, in many cases, the Data property provides more convenient access to Chart data.

Note: Script that modifies 'graph' should be placed at the element level. See Adding Element-Level Script in Report Scripting and Adding Component Script in Dashboard Scripting for more information.

Example (Setting the DataSet)

dataset = [["State","Quantity"], ["CA",200], ["NY",3000]];

graph = new EGraph();

var elem = new IntervalElement("State", "Quantity");

graph.addElement(elem);

Full Name

inetsoft.graph.data.DataSet

See Also

Binding Data to a Chart in Script, for various approaches to binding data to a chart.

Creating a Chart Using API Functions, for report and Viewsheet chart datasets.

DataSet: getData(), getRowCount(), getColCount()

<< CR.4.2 Table © 1996-2013 InetSoft Technology Corporation (v11.4) DataSet.getData(column,row) >>