本文整理汇总了Python中pygal.Pie.title方法的典型用法代码示例。如果您正苦于以下问题:Python Pie.title方法的具体用法?Python Pie.title怎么用?Python Pie.title使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pygal.Pie
的用法示例。
在下文中一共展示了Pie.title方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_donut
# 需要导入模块: from pygal import Pie [as 别名]
# 或者: from pygal.Pie import title [as 别名]
def test_donut():
chart = Pie(inner_radius=0.3, pretty_print=True)
chart.title = "Browser usage in February 2012 (in %)"
chart.add("IE", 19.5)
chart.add("Firefox", 36.6)
chart.add("Chrome", 36.3)
chart.add("Safari", 4.5)
chart.add("Opera", 2.3)
assert chart.render()
示例2: test_donut
# 需要导入模块: from pygal import Pie [as 别名]
# 或者: from pygal.Pie import title [as 别名]
def test_donut():
chart = Pie(inner_radius=.3, pretty_print=True)
chart.title = 'Browser usage in February 2012 (in %)'
chart.add('IE', 19.5)
chart.add('Firefox', 36.6)
chart.add('Chrome', 36.3)
chart.add('Safari', 4.5)
chart.add('Opera', 2.3)
assert chart.render()
示例3: test_pie_table
# 需要导入模块: from pygal import Pie [as 别名]
# 或者: from pygal.Pie import title [as 别名]
def test_pie_table():
chart = Pie(inner_radius=.3, pretty_print=True)
chart.title = 'Browser usage in February 2012 (in %)'
chart.add('IE', 19.5)
chart.add('Firefox', 36.6)
chart.add('Chrome', 36.3)
chart.add('Safari', 4.5)
chart.add('Opera', 2.3)
q = pq(chart.render_table())
assert len(q('table')) == 1
示例4: test_multiseries_donut
# 需要导入模块: from pygal import Pie [as 别名]
# 或者: from pygal.Pie import title [as 别名]
def test_multiseries_donut():
# this just demos that the multiseries pie does not respect
# the inner_radius
chart = Pie(inner_radius=0.3, pretty_print=True)
chart.title = "Browser usage by version in February 2012 (in %)"
chart.add("IE", [5.7, 10.2, 2.6, 1])
chart.add("Firefox", [0.6, 16.8, 7.4, 2.2, 1.2, 1, 1, 1.1, 4.3, 1])
chart.add("Chrome", [0.3, 0.9, 17.1, 15.3, 0.6, 0.5, 1.6])
chart.add("Safari", [4.4, 0.1])
chart.add("Opera", [0.1, 1.6, 0.1, 0.5])
assert chart.render()
示例5: test_multiseries_donut
# 需要导入模块: from pygal import Pie [as 别名]
# 或者: from pygal.Pie import title [as 别名]
def test_multiseries_donut():
# this just demos that the multiseries pie does not respect
# the inner_radius
chart = Pie(inner_radius=.3, pretty_print=True)
chart.title = 'Browser usage by version in February 2012 (in %)'
chart.add('IE', [5.7, 10.2, 2.6, 1])
chart.add('Firefox', [.6, 16.8, 7.4, 2.2, 1.2, 1, 1, 1.1, 4.3, 1])
chart.add('Chrome', [.3, .9, 17.1, 15.3, .6, .5, 1.6])
chart.add('Safari', [4.4, .1])
chart.add('Opera', [.1, 1.6, .1, .5])
assert chart.render()
示例6: test_donut
# 需要导入模块: from pygal import Pie [as 别名]
# 或者: from pygal.Pie import title [as 别名]
def test_donut():
file_name = '/tmp/test_graph-%s.svg' % uuid.uuid4()
if os.path.exists(file_name):
os.remove(file_name)
chart = Pie(inner_radius=.3, pretty_print=True)
chart.title = 'Browser usage in February 2012 (in %)'
chart.add('IE', 19.5)
chart.add('Firefox', 36.6)
chart.add('Chrome', 36.3)
chart.add('Safari', 4.5)
chart.add('Opera', 2.3)
chart.render_to_file(file_name)
with open(file_name) as f:
assert 'pygal' in f.read()
os.remove(file_name)
示例7: test_multiseries_donut
# 需要导入模块: from pygal import Pie [as 别名]
# 或者: from pygal.Pie import title [as 别名]
def test_multiseries_donut():
#this just demos that the multiseries pie does not respect the inner_radius
file_name = '/tmp/test_graph-%s.svg' % uuid.uuid4()
if os.path.exists(file_name):
os.remove(file_name)
chart = Pie(inner_radius=.3, pretty_print=True)
chart.title = 'Browser usage by version in February 2012 (in %)'
chart.add('IE', [5.7, 10.2, 2.6, 1])
chart.add('Firefox', [.6, 16.8, 7.4, 2.2, 1.2, 1, 1, 1.1, 4.3, 1])
chart.add('Chrome', [.3, .9, 17.1, 15.3, .6, .5, 1.6])
chart.add('Safari', [4.4, .1])
chart.add('Opera', [.1, 1.6, .1, .5])
chart.render_to_file(file_name)
with open(file_name) as f:
assert 'pygal' in f.read()
os.remove(file_name)