DataSet.getData(column,row)

Returns the value in the DataSet object specified by the column and row indices. The first column (index 0) contains the X-axis labels.

Parameters

column Column index of value to return

row Row index of value to return

Note: In many cases, the Data property is more convenient to use than DataSet.

For example, consider a chart with two datasets (measures), as shown below:

 

Note the index order: (column, row).

Use dataset.getData(j,i) with row index i and column index j to access these plotted values. The DataSet.getRowCount() and DataSet.getColCount() functions provide the number of rows and columns of summarized 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

var str = "";

 

// Loop through rows

for (var i = 0; i < dataset.getRowCount(); i++) {

   str = "";

   

   // Loop through columns

   for (var j = 0; j < dataset.getColCount(); j++) {

      str += dataset.getData(j, i) + ",";

   }

 

   // Output the results

   log(str);    // Style Studio

   alert(str);  // Visual Composer

 

}

The following output is written by the log() function (for Style Studio) to the Console window:

Sun May 31 00:00:00 EDT 2009, 1.0, 4.0,

Mon Jun 01 00:00:00 EDT 2009, 2.0, 5.0,

Tue Jun 02 00:00:00 EDT 2009, 3.0, 6.0,

Wed Jun 03 00:00:00 EDT 2009, 4.0, 7.0,

The values in the first column (e.g., Sun...2009, Mon...2009, etc.) are the dates on the X-axis, while the second and third columns represent the two datasets (Measure 1 and Measure 2).

See Also

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

Data, for information on accessing pre-aggregate data.

<< CR.4.3 DataSet © 1996-2013 InetSoft Technology Corporation (v11.5) DataSet.getRowCount() >>