@feds01/graphika / legend/draw-item
legend/draw-item
Type Aliases
LegendItemOptions
ts
type LegendItemOptions = {
colour: string;
font: string;
fontSize: number;
label: string;
style: BorderStyle;
textColour: string;
x: number;
y: number;
};Defined in: legend/draw-item.ts:15
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
colour | string | The colour for the legend box. | legend/draw-item.ts:19 |
font | string | Font family for the label text. | legend/draw-item.ts:31 |
fontSize | number | Font size for the label (also determines box size). | legend/draw-item.ts:27 |
label | string | The text label to display. | legend/draw-item.ts:17 |
style | BorderStyle | Border style: 'solid' or 'dashed'. | legend/draw-item.ts:21 |
textColour | string | Colour for the label text. | legend/draw-item.ts:29 |
x | number | X coordinate for the legend box. | legend/draw-item.ts:23 |
y | number | Y coordinate for the legend box. | legend/draw-item.ts:25 |
Functions
drawLegendItem()
ts
function drawLegendItem(ctx, options): void;Defined in: legend/draw-item.ts:40
Draw a legend-style item (colored box + label) on the canvas.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | CanvasRenderingContext2D | The canvas rendering context. |
options | LegendItemOptions | Configuration for the legend item. |
Returns
void