Skip to content
sibexicoPublic

About

Simple tool for generate graphic charts

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

chartgen

Tiny C tool that turns a simple CSV file into an SVG chart.

CSV format

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:

  1. label
  2. numeric value
  3. 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_unit is not provided, value text is shown without a unit name.
  • If title/subtitle/axis names are not provided, they are left empty.

Build

make

On Windows, use a make + GCC toolchain (MinGW-w64).

Usage

./chartgen input.csv output.svg
./chartgen --version

Windows:

chartgen.exe input.csv output.svg
chartgen.exe --version

Example Charts

Horizontal:

Horizontal example

Vertical:

Vertical example

About

Simple tool for generate graphic charts

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages