Skip to main content

Module chart

Module chart 

Source
Expand description

§Chart Rendering

Engine-native chart generation. Each chart type produces a flat list of ChartPrimitive drawing commands. The PDF renderer iterates the list to emit vector graphics directly — no SVG intermediary.

Modules§

area
Area chart builder — like line chart but with filled regions under each series.
bar
Bar chart builder.
dot
Dot plot (scatter plot) builder.
line
Line chart builder.
pie
Pie/donut chart builder.

Enums§

ChartPrimitive
A drawing primitive emitted by chart builders.
TextAnchor
Text horizontal alignment for labels.

Constants§

AXIS_COLOR
AXIS_LABEL_FONT
DEFAULT_COLORS
Default color palette for chart series/slices.
GRID_COLOR
LABEL_COLOR
LABEL_MARGIN
TITLE_FONT
TITLE_HEIGHT
X_AXIS_HEIGHT
Y_AXIS_WIDTH

Functions§

format_number
Format a number compactly (1000 → “1K”, 1000000 → “1M”).
lighten_color
Lighten a hex color toward white by the given factor (0.0=unchanged, 1.0=white).
measure_label
Measure the width of a label string in Helvetica at the given font size.
nice_number
Round a range maximum to a “nice” number for axis ticks.
parse_hex_color
Parse a hex color string (#RGB or #RRGGBB) to a Color.
resolve_color
Get a color from the default palette by index, or parse a custom color string.