If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!


  • 0
    sif-baksh-10957  6 years ago

    More 

    my controller:

    import pygal
    
    def pie():
        response.headers['Content-Type']='image/svg+xml'
        pie_chart = pygal.Pie(width=400)
        pie_chart.title = 'Browser usage in February 2012 (in %)'
        pie_chart.add('IE', 39.5)
        pie_chart.add('Firefox', 26.6)
        pie_chart.add('Chrome', 26.3)
        pie_chart.add('Safari', 4.5)
        pie_chart.add('Opera', 2.3)
        return pie_chart.render()
    

     

    What am I doing wrong?

Commented on:

Implementing Web2Py+Pygal 2.0. Pygal is a dynamic SVG charting library, It features various graph types: Bar charts, Line charts, XY charts, Pie charts, Radar charts, Dot charts, Pyramid charts, Funnel charts and Gauge charts.

Hosting graciously provided by:
Python Anywhere