Embebed graphs using pygal

If we want the graph just as an svg (you wont be able to print it) you have to add this code to de controller:

chart = bar_chart.render(is_unicode=True)

and in the template:

{{ chart|safe }}

But if you want to generate a PNG on the fly:

chart = b64encode(bar_chart ...
more ...