EaxGridView.getLegend

Syntax

getLegend (eaxIndicator: PP.Exp.EaxObjectIndicator) : PP.Ui.IntervalsLegend;

Parameters

EaxIndicator. Metric type.

Description

The getLegend method returns an interval legend object, which type corresponds with the metric type passed as a parameter.

Comments

Available values of the EaxIndicator parameter:

Example

Executing the example requires that the HTML page contains the EaxGrid component named eaxGrid (see Example of Creating the EaxGrid Component). The component displays an express report with the table, for which the Background Color metric has been determined. A legend must be displayed for the Background Color table metric.

eaxGrid.Rendered.add(function () {
	var legend = eaxGrid.getLegend(PP.Exp.EaxObjectIndicator.BackgroundColor);
	// Set color and transparency of the brush for highlighting legend elements
	var brush = legend.getHighlightBrush();
	brush.setColor("#FF0000");
	brush.setOpacity(0.3);
	legend.setHighlightBrush(brush);
	// Set color of highlighted legend elements
	legend.setHighlightItemColor("LightSeaGreen");
	// Enable highlighting of legend elements
	legend.setDoHighlight(true);
	// Set mode of displaying highlighting on click
	legend.setHoverMode(PP.HoverMode.Click);
});
eaxGrid.refreshAll();

Click any element of the Background Color interval legend.

After executing the example, the following legend properties are changed: color and transparency of the brush for highlighting legend elements, color of highlighted elements; highlighting display mode on click is set, and highlighting of legend elements is enabled.

See also:

EaxGridView