# chart: a Go CLI that turns piped numbers into a ChartJS chart

> chart is a Go command line tool that reads tab separated data on standard input, infers the format of each line, and opens a ChartJS chart in the browser, with a debug mode that shows exactly what it parsed. It fits quick inspection of shell output, and it does not fit a scripted report pipeline that needs a reproducible image file.

**marianogappa/chart** — Quick & smart charting for STDIN

- Repository: https://github.com/marianogappa/chart
- Website: https://marianogappa.github.io/chart/
- Stars: 546 · Forks: 28
- Language: Go
- License: MIT
- Published: 2026-10-22 · Updated: 2026-10-22 · Language: en
- Canonical page: https://hysenlabs.com/projects/marianogappa-chart

## A pipe from shell output to a chart in the browser

chart is described as quick and smart charting for STDIN, and the whole idea fits in one line of shell: data goes in on standard input, a browser window comes out. The README's first example takes the history of your shell, extracts the second field of each line and charts it, which produces a pie chart of the commands you use most. That example is the reason the tool exists. Terminal output is already tabular in most cases, and the alternative before this kind of tool was to write a plotting script, or to copy the output into a spreadsheet, or to accept a wall of numbers. The audience is a developer or analyst working at a terminal who wants to see the shape of a result now. The tool is written in Go, distributed as a single binary, and licensed under MIT.

## Format inference per line, and a separator it will not guess

The intelligence in the tool is in the parsing. The README states that chart infers the STDIN format by analysing the line format on each line and computing the winner format. So the tool looks at the rows, works out which columns are numbers, which are strings and which are dates, and picks the dominant interpretation for the whole input. Two consequences follow from the design. First, when the input data is string-only, chart infers a word frequency pie chart use case, which is what turns the shell history example into a pie of command names rather than a chart of nothing. Second, and this is the part to remember, the separator is not inferred and defaults to a tab. The option list gives the separators as a space, a semicolon, a comma or a tab, with the tab as the default, and the tool will not detect a comma separated file on its own.

## Installing with go install, or taking a release binary

The syntax is short, because almost everything is a flag:

```
chart [options]
```

Installation has two documented paths. The first is the Go toolchain route, and the module path is part of the command:

```
go install github.com/marianogappa/chart@latest
```

The second is to take the latest binary for your operating system from the Releases section on GitHub. A first run is a pipe, with the chart type as a positional argument and the options after it. The simplest example in the README counts your most used terminal commands and draws a pie chart:

```
history | awk '{print $2}' | chart
```

The cheatsheet linked from the README is the reference for the option set, and it is worth opening next to a terminal because the options are named after what they change rather than after what they do: -t or --title for the title, -x and -y for the axis labels, --date-format for the date format, --zero-based to make the y axis begin at zero, and -h or --help for the usage text.

## Four chart types, and a log scale for bar charts only

The chart types are positional arguments: pie, bar, line and scatter. Two options change the appearance rather than the type. The log option switches to a logarithmic scale and the README marks it as bar chart only, which makes sense given that the option list also includes --zero-based to make the y axis begin at zero, a setting that would defeat a log scale. legacy-color switches back to the older colour set, and gradient turns on colour gradients. The axis and title flags are what make a chart presentable rather than merely readable. The date format option follows the Go time format reference, and the README's own line chart example passes --date-format 2006-01-02T15:04:05Z, which is the Go layout for RFC 3339 timestamps. That matters because the tool is aimed at API output, where dates arrive as strings that have to be told apart from other columns before they can be plotted on a time axis.

## The --debug output is how you check the chart is telling the truth

The README has a section titled with a lack of confidence, saying the author does not trust the chart is correct either, and the answer is the --debug flag. The README suggests using it to double-check, and gives the kinds of things that can go wrong: some rows could be being ignored due to parse failures, the separator could be incorrect, or column types could be inferred wrongly. The debug run reports the lines read, the inferred line format, the lines actually used, the counts of float, string and date columns, the chart type, the scale type and the separator:

```
$ cat /tmp/c | ./chart bar --debug
Lines read  3
Line format inferred    ff
Lines used  3
Float column count  2
String column count 0
Date/Time column count  0
Chart type  bar
Scale type  linear
Separator   [tab]
```

That output is the difference between a picture and a measurement. If the lines used count is lower than the lines read, rows were dropped by the parser. If the column counts do not match the shape of your data, the inference chose the wrong type for a column. And the separator line tells you immediately whether the tab default matches your input, which is the most common reason for a chart that looks empty.

## ChartJS in the browser, and the limits that come with it

The plotting is done in the browser by the ChartJS library, and the README says so directly. The tool is a Go program that parses, prepares data, and hands it to a JavaScript charting library running in a page. That architecture explains both the appeal and the two documented problems. The appeal is that you get a real charting library with no plotting code of your own. The problems are listed under known issues: JavaScript's floating point messes up the y axis, tracked as an issue on the project, and there is no histogram support, because ChartJS does not provide it. So the tool is only as accurate as the browser's number handling, and a chart type that ChartJS lacks cannot be added without replacing the drawing layer. The README also notes that the tool should work on Linux, Mac and Windows thanks to the open-golang library, which is how the browser is opened from a static binary.

## gnuplot for the cases chart does not cover, and a thin release record

The project is honest about its own limits, and it points elsewhere when the limit bites. The README says that if you have a use case that is not supported, the author would like to hear about it, but that if the case is too complex, gnuplot is the recommendation. That is a real difference in approach rather than a token mention: gnuplot is a scriptable plotting program with a much wider set of chart types and a file output path, while chart is a browser-oriented viewer that infers structure for you. For data coming out of a database, the README also points at the author's sql tool and notes that chart works with any mysql -Nsre query, which is the standard way to get tab separated rows out of MySQL. On the release side, the tags are old: v1.0.3 and v1.0.2 both landed on 2017-02-05, with v1.0.1 on 2017-01-31. The repository is not archived and the last push was on 2026-10-12, so the code still moves even though the tagged releases stopped in 2017. Two version claims in the documentation disagree, which is worth knowing before you build on it: the README says development requires Go version 1.11 or newer with module support, while the go.mod file in the repository declares go 1.18. The build is a plain Go build, and releases are produced with Goreleaser.

## Conclusion

chart fits an engineer who wants a picture of a pipeline result in seconds, from a shell prompt on Linux, Mac or Windows, without writing a plotting script. It does not fit a job that needs a PNG on disk, a histogram, or an axis that JavaScript floating point does not mangle. Verify first that your rows are separated by tabs, since the tool does not infer the separator, then run the same command with --debug to confirm the line count and the inferred column types before you trust the picture.

## FAQ

### How do I install the chart command?

The README gives two options: go install github.com/marianogappa/chart@latest, or taking the latest binary for your operating system from the Releases section on GitHub. The tool should work on Linux, Mac and Windows thanks to the open-golang library.

### How do I check that chart parsed my data correctly?

Add the --debug flag. The output reports the lines read, the inferred line format, the lines used, the float, string and date column counts, the chart type, the scale type and the separator, which is how you spot dropped rows or a wrong separator.

### What separator does chart expect in the input?

The separator is not inferred and defaults to a tab, according to the README. You can also use a space, a semicolon or a comma by passing that character as an option, so comma separated input has to be selected explicitly.

### Can chart draw a histogram?

No. The README lists no histogram support as a known issue, because ChartJS does not provide it, and it also lists an issue where JavaScript's floating point messes up the y axis. For chart types outside its support, the README points to gnuplot.

## Sources

- [License: MIT](https://github.com/marianogappa/chart/blob/master/LICENSE)
- [marianogappa/chart on GitHub](https://github.com/marianogappa/chart)
- [Project website](https://marianogappa.github.io/chart/)
- [README](https://github.com/marianogappa/chart/blob/master/README.md)
- [Releases](https://github.com/marianogappa/chart/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/marianogappa-chart
