Monday, December 14, 2009

Charting library

Sometimes you need to draw charts on more pragmatically way than is usually done. Unfortuately, most of the things out there pretty sucks or are in the good way to do so.

For some time I used PyChart, but due it's complexity and really odd api, I dumped it and get back to OpenOffice. Yes, I went back to stone age, from nice comfort of favorite editor to clicking on eat-all-available-memory OpenOffice.

From time to time, I stumble upon some library, but nothing I would be satisfied with. Until I found guile-charting.

Honestly, Guile is not my favorite package and I install it mostly to play with differences on Scheme implementations, but from no on, guile-charting will be probably the main reason why I will keep Guile package installed.

Here is the sample code (also on pastebin):
(use-modules (charting))

(make-bar-chart "Monthly status for Foo project"
(232 "Download")
(20 "Upload"))
(80 "Download")
(320 "Upload"))
(130 "Download")
(150 "Upload"))

#:write-to-png "usage.png"
#:chart-height 200
and will produce this:

You will also need guile-cairo for guile-charting.


Andy Wingo said...

Glad you were able to make Guile-Charting work for you!

The upcoming Guile 2.0 should work much better for you than 1.8. You'll need to pull your git tree for it to work, though.



Sanel Z. said...


Yes I know ;) I'm trying to keep up with major changes in Guile 2.0 and eagerly waiting official 2.0 release.