DataSource.Data

Syntax

Data: Number;

Description

The Data property determines data for a selected element of a specified series.

Comments

Use the setData method to set the property value and the getData method to get the property value. Property value cannot be set from JSON.

The setData method has the following parameters: value - data, id - series identifier, index - series element index, dimAttrId - attribute identifier.

The getData method has the following parameters: id, index, and dimAttrId.

Example

To execute the example, the HTML page must contain the Example of Creating the BubbleChart ComponentBubbleChart component named bubbleChart (see Example of Creating the BubbleChart Component). Process the DataChanged event  and set new data for the specified series element if it exists in the source. Get the first non-empty value of the specified attribute:

// Get data source
var dataSource = bubbleChart.getDataSources().ds0;
// Process data change event
dataSource.DataChanged.add(function (sender, args) {
    console.log("New value: " + args.Value);
});
// Set new data for the series if it exists in the source
if (dataSource.hasItem("Serie0_Point0")) {
    dataSource.setData(2101, "Serie0_Point0", 1, "DimX");
}
// Display the first non-empty value of the specified attribute
console.log("The first non-empty value: " + dataSource.getFirstNotNullData("DimY"));

After executing the example the browser console displays new data value and the first non-empty value of the specified attribute

New value: 2101

First non-empty value: 46.1

See also:

DataSource