Table¶
pygal also supports a html table export of given data using the render_table
option:
line_chart = pygal.Bar()
line_chart.title = 'Browser usage evolution (in %)'
line_chart.x_labels = map(str, range(2002, 2013))
line_chart.add('Firefox', [None, None, 0, 16.6, 25, 31, 36.4, 45.5, 46.3, 42.8, 37.1])
line_chart.add('Chrome', [None, None, None, None, None, None, 0, 3.9, 10.8, 23.8, 35.3])
line_chart.add('IE', [85.8, 84.6, 84.7, 74.5, 66, 58.6, 54.7, 44.8, 36.2, 26.6, 20.1])
line_chart.add('Others', [14.2, 15.4, 15.3, 8.9, 9, 10.4, 8.9, 5.8, 6.7, 6.8, 7.5])
line_chart.value_formatter = lambda x: '%.2f%%' % x if x is not None else '∅'
line_chart.render()
Default¶
Firefox | Chrome | IE | Others | |
---|---|---|---|---|
2002 | ∅ | ∅ | 85.80% | 14.20% |
2003 | ∅ | ∅ | 84.60% | 15.40% |
2004 | 0.00% | ∅ | 84.70% | 15.30% |
2005 | 16.60% | ∅ | 74.50% | 8.90% |
2006 | 25.00% | ∅ | 66.00% | 9.00% |
2007 | 31.00% | ∅ | 58.60% | 10.40% |
2008 | 36.40% | 0.00% | 54.70% | 8.90% |
2009 | 45.50% | 3.90% | 44.80% | 5.80% |
2010 | 46.30% | 10.80% | 36.20% | 6.70% |
2011 | 42.80% | 23.80% | 26.60% | 6.80% |
2012 | 37.10% | 35.30% | 20.10% | 7.50% |
line_chart = pygal.Bar()
line_chart.title = 'Browser usage evolution (in %)'
line_chart.x_labels = map(str, range(2002, 2013))
line_chart.add('Firefox', [None, None, 0, 16.6, 25, 31, 36.4, 45.5, 46.3, 42.8, 37.1])
line_chart.add('Chrome', [None, None, None, None, None, None, 0, 3.9, 10.8, 23.8, 35.3])
line_chart.add('IE', [85.8, 84.6, 84.7, 74.5, 66, 58.6, 54.7, 44.8, 36.2, 26.6, 20.1])
line_chart.add('Others', [14.2, 15.4, 15.3, 8.9, 9, 10.4, 8.9, 5.8, 6.7, 6.8, 7.5])
line_chart.value_formatter = lambda x: '%.2f%%' % x if x is not None else '∅'
line_chart.render_table()
Style¶
Firefox | Chrome | IE | Others | |
---|---|---|---|---|
2002 | ∅ | ∅ | 85.80% | 14.20% |
2003 | ∅ | ∅ | 84.60% | 15.40% |
2004 | 0.00% | ∅ | 84.70% | 15.30% |
2005 | 16.60% | ∅ | 74.50% | 8.90% |
2006 | 25.00% | ∅ | 66.00% | 9.00% |
2007 | 31.00% | ∅ | 58.60% | 10.40% |
2008 | 36.40% | 0.00% | 54.70% | 8.90% |
2009 | 45.50% | 3.90% | 44.80% | 5.80% |
2010 | 46.30% | 10.80% | 36.20% | 6.70% |
2011 | 42.80% | 23.80% | 26.60% | 6.80% |
2012 | 37.10% | 35.30% | 20.10% | 7.50% |
line_chart = pygal.Bar()
line_chart.title = 'Browser usage evolution (in %)'
line_chart.x_labels = map(str, range(2002, 2013))
line_chart.add('Firefox', [None, None, 0, 16.6, 25, 31, 36.4, 45.5, 46.3, 42.8, 37.1])
line_chart.add('Chrome', [None, None, None, None, None, None, 0, 3.9, 10.8, 23.8, 35.3])
line_chart.add('IE', [85.8, 84.6, 84.7, 74.5, 66, 58.6, 54.7, 44.8, 36.2, 26.6, 20.1])
line_chart.add('Others', [14.2, 15.4, 15.3, 8.9, 9, 10.4, 8.9, 5.8, 6.7, 6.8, 7.5])
line_chart.value_formatter = lambda x: '%.2f%%' % x if x is not None else '∅'
line_chart.render_table(style=True)
Total¶
Firefox | Chrome | IE | Others | Total | |
---|---|---|---|---|---|
2002 | ∅ | ∅ | 85.80% | 14.20% | 100.00% |
2003 | ∅ | ∅ | 84.60% | 15.40% | 100.00% |
2004 | 0.00% | ∅ | 84.70% | 15.30% | 100.00% |
2005 | 16.60% | ∅ | 74.50% | 8.90% | 100.00% |
2006 | 25.00% | ∅ | 66.00% | 9.00% | 100.00% |
2007 | 31.00% | ∅ | 58.60% | 10.40% | 100.00% |
2008 | 36.40% | 0.00% | 54.70% | 8.90% | 100.00% |
2009 | 45.50% | 3.90% | 44.80% | 5.80% | 100.00% |
2010 | 46.30% | 10.80% | 36.20% | 6.70% | 100.00% |
2011 | 42.80% | 23.80% | 26.60% | 6.80% | 100.00% |
2012 | 37.10% | 35.30% | 20.10% | 7.50% | 100.00% |
Total | 280.70% | 73.80% | 636.60% | 108.90% | 1100.00% |
line_chart = pygal.Bar()
line_chart.title = 'Browser usage evolution (in %)'
line_chart.x_labels = map(str, range(2002, 2013))
line_chart.add('Firefox', [None, None, 0, 16.6, 25, 31, 36.4, 45.5, 46.3, 42.8, 37.1])
line_chart.add('Chrome', [None, None, None, None, None, None, 0, 3.9, 10.8, 23.8, 35.3])
line_chart.add('IE', [85.8, 84.6, 84.7, 74.5, 66, 58.6, 54.7, 44.8, 36.2, 26.6, 20.1])
line_chart.add('Others', [14.2, 15.4, 15.3, 8.9, 9, 10.4, 8.9, 5.8, 6.7, 6.8, 7.5])
line_chart.value_formatter = lambda x: '%.2f%%' % x if x is not None else '∅'
line_chart.render_table(style=True, total=True)
Transposed¶
2002 | 2003 | 2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011 | 2012 | Total | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Firefox | ∅ | ∅ | 0.00% | 16.60% | 25.00% | 31.00% | 36.40% | 45.50% | 46.30% | 42.80% | 37.10% | 280.70% |
Chrome | ∅ | ∅ | ∅ | ∅ | ∅ | ∅ | 0.00% | 3.90% | 10.80% | 23.80% | 35.30% | 73.80% |
IE | 85.80% | 84.60% | 84.70% | 74.50% | 66.00% | 58.60% | 54.70% | 44.80% | 36.20% | 26.60% | 20.10% | 636.60% |
Others | 14.20% | 15.40% | 15.30% | 8.90% | 9.00% | 10.40% | 8.90% | 5.80% | 6.70% | 6.80% | 7.50% | 108.90% |
Total | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | 1100.00% |
line_chart = pygal.Bar()
line_chart.title = 'Browser usage evolution (in %)'
line_chart.x_labels = map(str, range(2002, 2013))
line_chart.add('Firefox', [None, None, 0, 16.6, 25, 31, 36.4, 45.5, 46.3, 42.8, 37.1])
line_chart.add('Chrome', [None, None, None, None, None, None, 0, 3.9, 10.8, 23.8, 35.3])
line_chart.add('IE', [85.8, 84.6, 84.7, 74.5, 66, 58.6, 54.7, 44.8, 36.2, 26.6, 20.1])
line_chart.add('Others', [14.2, 15.4, 15.3, 8.9, 9, 10.4, 8.9, 5.8, 6.7, 6.8, 7.5])
line_chart.value_formatter = lambda x: '%.2f%%' % x if x is not None else '∅'
line_chart.render_table(style=True, total=True, transpose=True)