Summary
Charta is a command-line tool written in Go for generating colorful terminal graphs. It supports multiple graph types and various input formats including JSON, YAML, and plain text. Charta provides flexible input options, colorful output with customizable colors, grouping capabilities for data analysis, and threshold support with warning and alert levels. Perfect for data visualization in terminal environments and shell scripting workflows.
Features
Multiple Graph Types
Simple value graphs and Min/Max/Average graphs for comprehensive data visualization.
Flexible Input
Support for JSON, YAML, TXT files, or stdin input for maximum flexibility.
Colorful Output
Terminal-based graphs with customizable colors (red, green, yellow, blue, magenta, cyan, grey, orange*, purple*).
*: only for Truecolor Terminals
Data Grouping
Group multiple values for averaging or analysis with configurable grouping options.
Threshold Support
Warning and alert thresholds with color coding for monitoring and alerting.
Customizable Display
Adjustable width, min/max values, labels, and colors for personalized visualization.
Easy Integration
Perfect for shell scripts, monitoring systems, and data analysis pipelines.
Installation Charta
$ # Build from source: $ git clone https://codeberg.org/spn109/charta.git $ go build -o charta $ # Make executable and install: $ chmod +x charta $ sudo mv charta /usr/local/bin/ $ # Or install directly with go: $ go install codeberg.org/spn109/charta@latest
Usage - Charta
Basic Command Structure
$ charta <graph-type> [graph-options] [values...]
Graph Types
Simple Graph
Displays a single value as a horizontal bar graph:
$ charta simple 75 $ charta simple --min 0 --max 100 --label "Utilisation CPU" 85

MinMax Graph
Displays minimum, average, and maximum values from a dataset:
$ ./charta minmax 10 20 30 40 50 $ ./charta minmax --label "Temps de Réponse" 120 150 180 200 175

Global Options
-f, --file <file>
: Input file (JSON, YAML, TXT) or "stdin"-g, --groupby <n>
: Group N values together (default: 1)-m, --min <value>
: Minimum scale value (default: 0)-M, --max <value>
: Maximum scale value (default: 100)-w, --width <value>
: Graph width in characters (default: 100)-l, --label <text>
: Label for the graph (default: "Label")-c, --color <color>
: Graph color (red, green, yellow, blue, magenta, cyan, grey, orange*, purple*)-W, --warning <value>
: Warning threshold (default: 50)-A, --alert <value>
: Alert threshold (default: 80)
*orange and purple require truecolor terminal support
Input File Formats
JSON Format
{ "type": "minmax", "values": [10, 20, 30, 40, 50] }
Examples
Display CPU usage with custom colors and thresholds
$ charta simple --label "Utilisation CPU" --warning 70 --alert 90 85

Analyze response times from JSON file
$ charta minmax --file response_times.json --label "Temps de Réponse API"

Monitor system metrics with stdin input
$ {for i in 45 67 23 89 12; do echo $i; done} | charta minmax --file stdin --color blue
