TreeMapItem.calculateBorderColor

Syntax

calculateBorderColor(color: Object);

Parameters

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

Description

The calculateBorderColor method calculates value of border color based on specified color.

Comments

This method returns a String-type value.

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 color object
var color = {R: 204, G: 80, B:91};
// Calculate and show color of item border
var borderColor = item.calculateBorderColor(color);
console.log("Calculated color of item border: " + borderColor)
// Calculate and show background color for the item
var color = item.calculateColor(color);
console.log("Calculated item background color: " + color)
// Calculate and show color of item text font
var fontColor = item.calculateFontColor(color);
console.log("Calculated color of item text font: " + fontColor)

After the example execution the browser console shows new calculated values of item border color, item background color and color of item text font:

Calculated color of item border: #fe828d

Calculated item background color: #cc505b

Calculated color of item text font: #FFFFFF

See also:

TreeMapItem