Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

zlypher/go-plot

Repository files navigation

go-plot

go-plot is a utility library to display simplistic charts in a command line.

Build Status License: MIT

Table of Contents

Getting Started

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"
)

Example

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

Contributing

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

License

MIT License (see LICENSE.md)

About

go-plot is a utility library to display simplistic charts in a command line.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published