Flexible SVG text label component with 13 positioning modes.
Inspired by Recharts' <Label> — positions text relative to a bounding box
using intuitive position atoms.
Examples
<.chart_label
value="42"
position={:top}
x={100}
y={50}
width={80}
height={30}
/>
<.chart_label value="Max" position={:inside_top_right} x={10} y={10} width={200} height={100} />
Summary
Functions
Attributes
value(:any) (required) - Label text content.position(:atom) - Label position relative to the bounding box. Defaults to:top. Must be one of:top,:bottom,:left,:right,:center,:inside_top,:inside_bottom,:inside_left,:inside_right,:inside_top_left,:inside_top_right,:inside_bottom_left, or:inside_bottom_right.x(:any) - Bounding box X origin. Defaults to0.y(:any) - Bounding box Y origin. Defaults to0.width(:any) - Bounding box width. Defaults to0.height(:any) - Bounding box height. Defaults to0.offset(:integer) - Offset from edge in px. Defaults to5.font_size(:string) - Font size for the label. Defaults to"9".color(:string) - Fill color override. Defaults tonil.class(:string) - Defaults tonil.- Global attributes are accepted.