Skip to main content

Module text

Module text 

Source
Expand description

Plain-text chart renderer. Draws ChartSpec as a block of text suitable for the CLI’s log region, terminal stdout, or any context where SVG/canvas/ratatui widgets aren’t available.

Bar and stacked-bar specs render as horizontal bars sized to the biggest magnitude. Line specs render as a per-series sparkline. The output is purely monospace text — no colour — so it survives pasting into logs and scrolling.

Functions§

render_text
Render spec to a multi-line string. width controls how wide each bar gets (min 10, max ~200 is sensible).
render_text_default
Default-width convenience wrapper: 48 columns, readable in the typical terminal log pane.