TreeMap.getColorOptions

Syntax

getColorOptions();

Description

The getColorOptions method gets color panel settings in wizard settings format.

Comments

This methods returns an array of JSON objects with the following fields: Name - property name, Value - property value.

Example

To execute this example, the page must contain the TreeMap component named treeMap (see Example of Creating the TreeMap Component). Get and show value of fill color when no data is available using color panel setting, value of size scale type using size panel settings, legend position value using settings of the legend panel, and chart settings ID. Show value of chart items offset and the number of items available in the chart:

// Get settings for color panel in wizard settings format
var colorOptions = treeMap.getColorOptions();
// Get and show value of fill color used when no data is available
for (var i = 0; i < colorOptions.length; i++) {
    var option = colorOptions[i];
    if (option.Name == "TreeChartMaster.ColorPanel.NoDataColor") {
        var noDataColor = option.Value;
        console.log("Bubble fill color when no data is available for this bubble: R:" + noDataColor.getR() +
            ", G:" + noDataColor.getG() + ", B:" + noDataColor.getB());
    }
}
// Get settings for size panel in wizard settings format
var sizeOptions = treeMap.getSizeOptions();
// Get and show value of size scale type
console.log("Size scale type: " + sizeOptions[0].Value);
// Get settings for legend panel in wizard settings format
var legendOptions = treeMap.getLegendOptions();
// Get and show value of legend position
console.log("Legend position: " + legendOptions[0].Value)
// Get component settings in wizard settings format
var state = treeMap.getState();
// Show settings ID
console.log("Settings ID: " + state.getId());
// Get value of chart items offset
console.log("Value of chart items offset: " + treeMap.getLeafMargin());
// Show the number of items available in the chart
console.log("Number of items in the chart: " + treeMap.getSceneItems().length)

After the example execution the browser console shows the following data: value of fill color when no data is available, value of size scale type, legend position value, chart settings ID, value of chart items offset, and the number of items available in the chart:

Bubble fill color when no data is available for this bubble: R:191, G:191, B:191

Size scale type: Linear

Legend position: Bottom&Center

Settings ID: PropertyChangedEventArgs784

Value of chart items offset: 15

Number of items in the chart: 10

See also:

TreeMap