getLegend (eaxIndicator: PP.Exp.EaxObjectIndicator) : PP.Ui.IntervalsLegend;
EaxIndicator. Metric type.
The getLegend method returns an interval legend object, which type corresponds with the metric type passed as a parameter.
Available values of the parameter:
PP.Exp.EaxObjectIndicator.BackgroundColor. The Background Color legend.
PP.Exp.EaxObjectIndicator.FontColor. The Font Color legend.
PP.Exp.EaxObjectIndicator.FontSize. The Font Size legend.
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 legend element highlighting var brush = legend.getHighlightBrush(); brush.setColor("#FF0000"); brush.setOpacity(0.3); legend.setHighlightBrush(brush); // Set color of highlighted legend elements legend.setHighlightItemColor("LightSeaGreen"); // Enable legend element highlighting legend.setDoHighlight(true); // Set highlighting display mode on click legend.setHoverMode(PP.HoverMode.Click); }); eaxGrid.refreshAll();
Click any element of the Background Color interval legend with the left mouse button.
After executing the example, the following legend properties have been changed: color and transparency of the brush for highlighting legend elements, color of highlighted elements; highlighting display mode on click has been set, and highlighting of legend elements has been enabled.
See also: