go-plot is a utility library to display simplistic charts in a command line.
Table of Contents
To get started, simply go get
the library and import it into your file.
go get github.com/zlypher/go-plot
import (
"github.com/zlypher/go-plot"
)
main.go
package main
import (
"github.com/zlypher/go-plot"
)
func main() {
var entries []plot.Entry
entries = append(entries, plot.Entry{Label: "Lorem Ipsum", LabelAbbr: "A", XValue: 1, YValue: 1})
entries = append(entries, plot.Entry{Label: "Lorem Ipsum", LabelAbbr: "B", XValue: 2, YValue: 2})
entries = append(entries, plot.Entry{Label: "Lorem Ipsum", LabelAbbr: "C", XValue: 3, YValue: 3})
spacing := plot.Spacing{Margin: 2, Padding: 2, Bar: 1, Axis: 1}
chart := plot.Chart{
Title: "",
Debug: false,
Spacing: spacing,
Entries: entries,
}
plot.BarChart(chart)
}
Example Output
|
| +
| + +
| + + +
+-----------
A B C
This is a small side project, so there currently are not strict standards for contributing. If you find any issues or have suggestions, feel free to create an issue or a pull request
MIT License (see LICENSE.md)