Go chart

From wikinotes

Chart is a go program that makes it easy to render diagrams both inside your console and out.

Documentation

github https://github.com/marianogappa/chart
official cheatsheet https://marianogappa.github.io/chart/

Install

go get -u github.com/marianogappa/chart

# ?
cd ~/go/src/githug.com/marianogappa/chart
go build
go install

# make sure your `$(go env GOPATH)/bin` is on your $PATH

Usage

The syntax here feels a little illogical, but the results work if bent correctly.

General options

-x/-y <name>  # name of x/y axis
# pie graph of occurrences of cat vs dog
echo '
cat
dog
cat' | chart
# x         y-for-each-line
echo '
2020-01-01    1 1  1
2020-01-02    2 3  5
2020-01-03    3 5 10
' | chart line ' '
# NOTE: x-val MUST be a date/datetime for this to work.

# line-name  x-val  y-val
echo '
server1 2020-01-01 1
server1 2020-01-02 2
server2 2020-01-02 1
server2 2020-01-02 3
' | chart line log ' ' --date-format 1970-01-01