getData(id: String);
id. Series identifier.
The getData method returns scale item or converted data by series identifier.
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). Get element color for the first and last data series:
// Get object of mapping of data series and bubble chart bubble colors var colorVisual = bubbleChart.getColorVisual(); // Get data mapping settings var mapping = colorVisual.getColorMapping(); // Get first series element var data = mapping.getData("Serie0_Point0"); // Get first series element console.log("First series element color: " + data.getColor()); // Get last data series var item = mapping.getDataSourceItem("Serie27_Point0"); // Get last series element color data = mapping.transformDataSourceItem(item); // Get last series element color console.log("Last series element color: " + data.getColor());
As the result of the example execution the browser console displays element color for the first and last data series:
Color of the first series' element: #EBAF36
Color of the last series' element: #FF462C
See also: