-
Notifications
You must be signed in to change notification settings - Fork 0
Legend
Legend shows additional information about plot, for example name, color or size information. Legend is dynamic: it changes with data changings to show only actual information. There are two types of legends:
- Compact legend is used by IDD as default legend. It allows to show and hide certain plots.
-
Extended legend is used by Chart Viewer as default legend. It allows to show and hide certain plots and reorder plots in a legend to change
z-index
of plots.
Legend of a specific plot can be shown in any DIV element (it can be placed either inside or outside of the plot) by setting attribute “data-idd-legend”
. Value of this attribute should be the id of a DIV element for legend. Master plot merges all legends of its dependent plots into one. Only chart has predefined legend. The content of legend DIV can be changed by overwriting getLegend()
method of plot. This method should return jQuery DIV element containing legend content.
Legend can be made invisible by changing “isVisible”
property (chart has specific style field “isLegendVisible”
for this purpose). To remove legend from DIV element call remove()
method.
An example of creating legend for figure:
<div data-idd-plot="figure" data-idd-legend="legend" style="width: 500px; height: 200px">
<div id="line" data-idd-plot="polyline" data-idd-style="stroke: blue"></div>
<div id="legend" style="float: left"></div>
</div>
You can also add legend into DIV element by using InteractiveDataDisplay.Legend(plotDiv, legendDiv, isCompact)
. This function creates legend for plots in plotDiv
element and put it in legendDiv
element. If isCompact
is true
the function creates compact legend otherwise extended legend.
Home
FAQ
UI Guidelines
Export to SVG
Plot
Figure
Chart
ChartViewer
Polyline
Markers
Area
Heatmap
DOM Plot
Labels
Bing Maps
Intro
General bindings
Area plot
Bars plot
Polyline
Heatmap
Markers
Label plot
Box and whisker plot
Petals and BullEye plot
Axis
Palette Editor
Update layout
Axes
Legend
Color Palette
Navigation
Bound Plots
Tooltips and Probes