Legend identifies the patterns or colors that are assigned to the data series or categories in a chart.
Davisor Chart supports two placements for legends. Internal legend is drawn inside an other chart. External legend is drawn as a separate chart using the same data and attributes as the chart it describes. An external legend can be created by giving chartType="legend" attribute within the <attributes> tag. An internal legend can be created by giving a <legend/> tag into chart attributes. That <legend/> tag can also be used to control the rendering of the external legend.
Both internal and external legends have a few legend types. These types are:
The type of the legend is given in legendType attribute for an internal legend. If a normal legend is wanted, the attribute is not needed. The paint and shape scale legends are selected for internal legends with legendType="paintLegend" and legendType="shapeLegend", respectively. For an external legend, the scale legends are selected with chartType="paintLegend" or chartType="shapeLegend" attribute.
Normal legend is rendered in single or multi series mode. That mode is usually determined from the number of value columns or groups in data, but can also be set explicitly with the multiseriesMode attribute within <attributes> tag.
A legend entry consists of a symbol and a name. The symbol describes the represented data series or category as faithfully as possible, so that the name can be connected to the proper data series or category. Series attributes and annotations that cannot be resolved unambiguosly are ignored when rendering the symbol. If shape is defined, the symbols show the shape and a line. Otherwise the symbol is a rectangle.
Paint scale legend visualizes a paint scale that is attached to normal data. Scales are used in other charts for showing more than just one information when a data point is visualized as described in Visualization Scales.
Paint scale legend ignores the multiseriesMode attribute.
Shape scale legend visualizes a shape scale that is attached to normal data.
Paint scale legend ignores the multiseriesMode attribute.
The orientation of the legend is determined automatically. Automatic determination of the orientation can be overridden by setting an orientation attribute within the <legend> tag.
Mandatory channels: value for normal legend, paint for paint scale legend, shape for shape scale legend.
Optional channels: label, paint, color, shape, stroke, alt, and url for normal legend
|
| Single series chart, so legend shows category names. |
|
| Multi series chart, so legend shows series names. |
|
| Single series chart, forced to multiseriesMode. |
|
| Multi series chart, forced out from multiseriesMode. |
|
| Paint scale legend. |
|
| The orientation of the legend forced to vertical. |