DataSource.clear

Syntax

clear();

Description

The clear method clears data source.

Example

To execute the example, the HTML page must contain the component named bubbleChart (see Example of Creating the BubbleChart ComponentBubbleChart component named bubbleChart (see Example of Creating the BubbleChart Component). Clear the data source and check if the data for the element with the index 1 is loaded:

// Get data source
var dataSource = bubbleChart.getDataSources().ds0;
// Clear the data source
dataSource.clear();
// Check if the data for the element with the index 1 is loaded
if (dataSource.isIndexLoaded(1) == False) {    
    console.log("Data for the element with the index 1 is not loaded")
};

After executing the example the data source is cleared, and the browser console displays a message informing that the data for element with the specified index is not loaded:

Data for the element with the index 1 is not loaded

See also:

DataSource