Documentation / @finchart/dom / legend
Function: legend()
legend(
options?):Plugin<OverlayHost&PaneHost&PlotEventSource&XCoordinates,ConfigurablePluginApi<Omit<LegendOptions,"pane">>>
Defined in: dom/src/legend.ts:48
Shows series names, colors, and values in the pane's top-left corner.
Values follow the cursor — with no cursor (outside the chart), it shows the last point's value. That's the trading-chart convention. The ingredients are the same as the tooltip's: the crosshair event + Pane.probe + overlay. The list is re-queried on every render — series being added or removed is learned from the render event.
Registrations with no name are skipped — a row with nothing to call it is just noise.
Parameters
options?
LegendOptions = {}
Returns
Plugin<OverlayHost & PaneHost & PlotEventSource & XCoordinates, ConfigurablePluginApi<Omit<LegendOptions, "pane">>>