CanvasLabel.updateContent

Syntax

updateContent();

Description

The updateContent method refreshes canvas label text.

Example

To execute the example the HTML page must contain the TreeMap component named (see Example of Creating the TreeMap Component), a label must also be created on the canvas (see CanvasLabel Constructor). Set minimum font size for canvas label and enable cutting of the text that does not fit by width and adding the dots:

// Set minimum font size
canvasLabel.setMinSize(22);
// Cut text by width and add the dots
canvasLabel.setTextWrapping(PP.Ui.TextWrapping.Ellipsis);
// Refresh label text
canvasLabel.updateContent();
console.log("New text of label: «%s»", canvasLabel._contentStrings[0]);

After executing the example label font size is increased to 22 pixels, due to this the text that does not fit is cut, and the dots is added:

New text of label: "Cr..."

CanvasLabel