PCLine.toggleTooltip

Syntax

toggleTooltip(coord: Object);

Parameters

coord. Object that contains X coordinate of the tooltip position. The object must include the X field.

Description

The toggleTooltip method shows and hides tooltip for the chart line.

Example

Executing the example requires the ParallelCoordinates component named coord (see Example of Creating the ParallelCoordinates Component). Get border color and text value for the tooltip of the first line:

// Get the first line in the chart
line = coord.getLines()[0];
// Get border color for the tooltip of the first line
console.log("Border color for the tooltip of the first line: " + line.getTooltipColor());
// Get text value for the tooltip of the first line
console.log(Text value for the tooltip of the first line: " + line.getTooltipValues().Name);

After that the console shows border color and text value for the tooltip of the first line:

Border color for the tooltip of the first line: #82BAB6

Text value for the tooltip of the first line: Line 1

 

Set that tooltip for the first line appears on clicking the line and show the tooltip:

// Set that tooltip for the first line appears on clicking the line
line.getTooltip().setHoverMode(PP.HoverMode.Click);
// Show tooltip for the first line
line.toggleTooltip({
    X: 50
});
// Refresh the chart
coord.refresh();

As a result, the tooltip for the first line is shown:

See also:

PCLine