Sparklines for Go.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore Initial commit Jun 12, 2014
LICENSE Initial commit Jun 12, 2014 Update README for 150 stars Dec 15, 2015
spark.go Added handling for empty slice Jun 15, 2014
spark_test.go Added handling for empty slice Jun 15, 2014


Sparklines for Go, inspired by holman/spark. Why this deserves 150 stars I will never know.

A quick example:

import (

boring_data := []float64{1, 2, 3, 4, 5, 6, 7, 8}

sparkline := spark.Line(boring_data)


> "▁▂▃▄▅▆▇█"

Grab it with go get

Now some more interesting examples.

Nats season batting averages at a certain point in their 2014 season:

avgs := []float64{.270, .272, .293, .310, .274, .239, .237, .238, .111}

> "▇▇██▇▆▆▆▁"

Not too cool, but it is easy to see where the problem is in this lineup. You'll have to blame the National League's rules though, not Treinen. Anyway, have a look at average monthly highs in Phoenix:

temps := []float64{67, 71, 77, 85, 95, 104, 106, 105, 100, 89, 76, 66}

> "▁▂▃▄▆███▇▅▃▁"

Doesn't say much without knowing the min and max there (about 65° and 105°—why do people live there, again?) but you can clearly see the seasonal trend.

  • Zach Holman does a great sell too, and this is really just a port of his neat tool. There are some cool examples there.
  • @tv added a main() with arg parsing so you can use it in your terminal. You can find that here.
  • Oh, and if you really want, you can pore over the full docs at

Licensed under GPLv3.