Expand description
Legend layout and rendering.
This module handles the positioning, measurement, and drawing of legend
boxes within a plot area. A legend consists of one or more LegendEntry
items, each displaying a color swatch (line segment or filled rectangle)
alongside a text label.
§Usage
- Build a
Vec<LegendEntry>from the artists on your axes (typically by iterating over labeled artists and callingLegendEntry::lineorLegendEntry::filled). - Call
draw_legendwith the renderer, entries, plot area, desiredLoc, and activeTheme.
The legend is drawn last in the render pipeline so it appears on top of all data elements.
Structs§
- Legend
Entry - A single legend entry consisting of a color swatch and a text label.
Enums§
- Swatch
Kind - Describes the visual representation of a legend swatch.
Functions§
- draw_
legend - Renders a legend box at the specified location within the plot area.