Pie Charts

Pie charts work well in displaying group level data or proportions of contribution to the sum total by individual groups. As an added bonus, pygal pie chart have a select and de-select feature for choosing which group to remove on the pie chart.

This examples, builds a simple Pie chart of fictitious marketing budget across different advertising channels.

channels = ['TV', 'Radio', 'News Paper', 'Online', 'Direct Mail']
budget_proportion = [30, 15, 10 ,40, 5]

budget = list(zip(channels, budget_proportion))
import pygal

pie_chart = pygal.Pie()
pie_chart.title = 'Advertising Budget by Channel (in %)'

for i in budget:
    pie_chart.add(i[0], i[1])
pie_chart.render_in_browser()

pie_chart.render_in_browser()
Advertising Budget by Channel (in %)30420.00339187414994196.3776019370593515407.7588797595637351.958879759563710322.8387.1540202.65267.05304.00439902541626148.3292458774942Advertising Budget by Channel (in %)TVRadioNews PaperOnlineDirect Mail