本文整理汇总了Python中pygal.Bar.render方法的典型用法代码示例。如果您正苦于以下问题:Python Bar.render方法的具体用法?Python Bar.render怎么用?Python Bar.render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pygal.Bar
的用法示例。
在下文中一共展示了Bar.render方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_xml_filters_round_trip
# 需要导入模块: from pygal import Bar [as 别名]
# 或者: from pygal.Bar import render [as 别名]
def test_xml_filters_round_trip():
plot = Bar()
plot.add("A", [60, 75, 80, 78, 83, 90])
plot.add("B", [92, 87, 81, 73, 68, 55])
before = plot.render()
plot.add_xml_filter(lambda T: T)
after = plot.render()
assert before == after
示例2: graph_records
# 需要导入模块: from pygal import Bar [as 别名]
# 或者: from pygal.Bar import render [as 别名]
def graph_records(record_files):
chart = Bar(BaseConfig)
max_len = max(map(len, record_files.values()))
for name, record_list in sort_domains(record_files.items()):
chart.add(name, [x[0].total_seconds()/86400 for x in record_list] +
[None] * (max_len - len(record_list)))
return chart.render()
示例3: test_chart_renders
# 需要导入模块: from pygal import Bar [as 别名]
# 或者: from pygal.Bar import render [as 别名]
def test_chart_renders():
line_chart = Bar(print_values=True, percent_values=True, print_values_position='top')
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])
assert line_chart.render()