サンプルコード
# coding=UTF-8 import pygal chart = pygal.Pie(title=u"部門別売上") chart.add(u'部門1', 200) chart.add(u'部門2', 170) chart.add(u'部門3', 50) chart.render_to_file('chart13.svg') chart.render_to_png(filename='chart13.png')
出力画像
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1HwF8awA9BK9fLuaVPEs-Ygu-TUc1MKjrbkyEdf8u8v5OVFjJUjbAA1X5WP123Ad6Dt7XZjwabvT6l1Wk1xxxaTZghdVvy6HhS4x9xSa1uHSzV0eBv9REYXXabRFO1GrbP-ND/s320/chart13.png)
# coding=UTF-8 import pygal chart = pygal.Line(x_title=u'年度', y_title=u'百万', show_dots=False) chart.x_labels = map(str, range(2013, 2016)) chart.add(u'部門1', [100, 200, 300]) chart.add(u'部門2', [150, 170, 320]) chart.add(u'部門3', [None, 50, 1000]) chart.render_to_file('chart12.svg') chart.render_to_png(filename='chart12.png')