TreeMapItem.calculateLeafColor

Syntax

calculateLeafColor(color1: Object);

Parameters

color1. Color value. This object contains the following fields: R - red color component, G - green color component, B - blue color component.

Description

The calculateLeafColor method calculates value of item color.

Comments

This method returns a String-type value in #RRGGBB format.

Example

To execute this example, the page must contain the TreeMap component named treeMap (see Example of Creating the TreeMap Component). Calculate new color of the item border, item background color and item text font color:

// Get chart item with the index 3
var item = treeMap.getSceneItems()[3];
// Create new colors
var color1 = {R: 100, G: 150, B: 200};
// Calculate and show item color
LfColor = item.calculateLeafColor(color1)
console.log("Item color: " + BrColor)	

After the example execution the browser console shows values of item color:

Item color: "#6496c8"

See also:

TreeMapItem