--- author: '' category: '' date: 2013/07/30 06:10:45 description: Nice and easy charts, using PyGal! link: '' priority: '' slug: new-nikola-feature-svg-charts-via-pygal tags: python, nikola title: 'New Nikola Feature: SVG Charts via Pygal' type: text updated: 2013/07/30 06:10:45 url_type: '' --- I can't sleep, so I just whipped together a docutils directive that wraps `pygal `_ for `Nikola, `_ my static site and blog generator. So, how do you use it? LIke this:: .. chart:: Bar :title: 'Browser usage evolution (in %)' :x_labels: ["2002", "2003", "2004", "2005", "2006", "2007"] 'Firefox', [None, None, 0, 16.6, 25, 31] 'Chrome', [None, None, None, None, None, None] 'IE', [85.8, 84.6, 84.7, 74.5, 66, 58.6] 'Others', [14.2, 15.4, 15.3, 8.9, 9, 10.4] .. TEASER_END Which produces this: .. chart:: Bar :title: 'Browser usage evolution (in %)' :x_labels: ["2002", "2003", "2004", "2005", "2006", "2007"] 'Firefox', [None, None, 0, 16.6, 25, 31] 'Chrome', [None, None, None, None, None, None] 'IE', [85.8, 84.6, 84.7, 74.5, 66, 58.6] 'Others', [14.2, 15.4, 15.3, 8.9, 9, 10.4] You can customize the output *a lot*, because Pygal is very configurable, and it supports a very wide variety of charts. Also, the charts are somewhat interactive, which is nice. It's a pathetically `simplistic piece of code `_ but it seems to work well :-)