Build Status Hackage lts nightly

chart-unit is a haskell chart library focusing on a small set of high-quality charts using native haskell. Here's a recent example, chock-a-block full of titles and legends (that needed testing):

Chart Types

So far, there are 9 major chart types:

Why the name chart-unit?

Most of the behind-the-scenes grunt work is scaling data, projecting points from one range to another, and computing position. A key to making these computations neat was one = Range -0.5 0.5 and one = Rect -0.5 0.5 -0.5 0.5 as the (multiplicative) units of a chart range. See numhask-range for a monologue.

generic-lens rocks

generic lens is the future of api in haskell:

What's with the funny names?

Charting is an age-old craft, and stuffed to the brim with cliche and jargon. I wanted to cut through the cruft of what is thought of as a chart (and charting has been dominated by excel for 30 years), and approach charting from a haskelly perspective. The funny names were the cohorts that popped out. A rough translation:

ye-old Chart type chart-unit type
line LineChart
line chart with markers GLineChart
scatter GlyphChart
pie pull requests welcome
heatmap PixelChart
Bar RectChart
Histogram RectChart
sparkline a skinny Aspect


Composable chart types and the power of diagrams make it easy to invent new charts. Here's some inspiration (all code for these charts is in examples/gallery.hs).



Chart.Data.Time deals with the scenario where you want to plot a time series consecutively (y values are [0..]) but there are gaps in the seris such as no data on weekend days.


From the Haskell survey ...



histogram diff

combined scatter histogram




Differences between text methods, across alignments


stack build --test --haddock --exec "$(stack path --local-install-root)/bin/chart-unit-source-examples" --exec "$(stack path --local-install-root)/bin/chart-unit-main-example" --exec "$(stack path --local-install-root)/bin/chart-unit-gallery" --exec "$(stack path --local-bin)/pandoc -f markdown -i other/ other/ -t html -o index.html --filter pandoc-include --mathjax" --file-watch