YOUSEFUL / DELPHI / COMPONENTS
TAtlasLegendEntry
One line of a legend drawn by TAtlasCustomChart.DrawLegend: a caption and a swatch colour.
Description
Passed in an array to the protected DrawLegend of TAtlasCustomChart when a descendant draws its legend. The radar chart builds one entry per series.
Members
| Member | Kind | What it does |
|---|---|---|
Caption | field | Text beside the swatch; shortened with ... when the legend column is too narrow. |
Color | field | Fill and outline of the square swatch. |
Fields
Caption field
Caption: string;Text beside the swatch; shortened with ... when the legend column is too narrow.
Color field
Color: TColor;Fill and outline of the square swatch. Resolve clDefault yourself (for example with PaletteColor) before drawing.
Examples
Build legend entries
Inside a descendant's DrawChart, pass the entries to DrawLegend and draw into the area it returns.
uses
Atlas.ProChart;
function TwoEntries: TArray<TAtlasLegendEntry>;
begin
SetLength(Result, 2);
Result[0].Caption := 'Measured';
Result[0].Color := TAtlasCustomChart.PaletteColor(0);
Result[1].Caption := 'Target';
Result[1].Color := AtlasAxisColor;
end;