Tiny C tool that turns a simple CSV file into an SVG chart.
All fields must be wrapped in double quotes. This is required so commas inside text never break parsing.
Data rows use 2 or 3 columns:
- label
- numeric value
- color (optional, hex like
#3B82F6)
The chart direction is required:
"@orientation","horizontal""@orientation","vertical"
Optional metadata rows:
"@x_axis","Your X axis name""@y_axis","Your Y axis name""@title","Chart title""@subtitle","Chart subtitle""@value_unit","ops/s"
You can keep a header row ("label","value","color") or skip it.
Example:
"@orientation","horizontal"
"@title","Values comparison"
"@subtitle","Comparing 2 values"
"@x_axis","Axis X"
"@y_axis","Axis Y"
"@value_unit","ops/s"
"label","value","color"
"1st value","68000","#3B82F6"
"2nd value","94000","#10B981"- Empty lines are ignored.
- Lines starting with
#are ignored. - Numeric value must be numeric even though it is quoted.
- Color is optional. If omitted (or invalid), built-in palette is used.
- If
@value_unitis not provided, value text is shown without a unit name. - If title/subtitle/axis names are not provided, they are left empty.
makeOn Windows, use a make + GCC toolchain (MinGW-w64).
./chartgen input.csv output.svg
./chartgen --versionWindows:
chartgen.exe input.csv output.svg
chartgen.exe --versionHorizontal:
Vertical: