tochart
Render charts in the terminal from a record stream.
Synopsis
bash
recs tochart [options] [files...]Description
Render charts in the terminal from a record stream. Supports bar charts (horizontal Unicode block characters), line charts (braille-dot canvas), scatter plots (braille-dot canvas), and sparklines (vertical block characters). Can optionally write SVG output to a file.
Options
| Flag | Description |
|---|---|
--key / -k / --fields / -f <keys> | Value keys to chart. May be specified multiple times or comma-separated. (required) |
--type <type> | Chart type: bar (horizontal bars), line (braille line plot), scatter (braille scatter), sparkline (compact block characters). Default: bar. |
--title <title> | Title displayed above the chart. |
--width <n> | Chart width in characters. Default: 80. |
--height <n> | Chart height in character rows. Default: 20. |
--label-key <key> | Key to use for bar labels or x-axis category names. If not specified, records are labeled by index. |
--color / --no-color | Enable or disable ANSI color output. Colors are enabled by default. |
--output-file <file> | Write an SVG chart to the specified file instead of rendering to the terminal. |
--dump-spec | Dump parsed configuration and data lines (for testing). |
Examples
Bar chart of counts by user
bash
recs tochart --key ct --label-key uidLine chart of values
bash
recs tochart --key value --type line --title 'Values over time'Scatter plot of x vs y
bash
recs tochart --key x,y --type scatterSparkline of a value field
bash
recs tochart --key value --type sparklineSave chart as SVG
bash
recs tochart --key ct --label-key uid --output-file chart.svgMultiple series bar chart
bash
recs tochart --key sales,profit --label-key region --title 'By Region'