当前位置: 首页>>代码示例>>Python>>正文


Python Pie.title方法代码示例

本文整理汇总了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()
开发者ID:jespinoza711,项目名称:pygal,代码行数:11,代码来源:test_pie.py

示例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()
开发者ID:AlanRun,项目名称:UiAutoTest,代码行数:11,代码来源:test_donut.py

示例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
开发者ID:AlanRun,项目名称:UiAutoTest,代码行数:12,代码来源:test_table.py

示例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()
开发者ID:jespinoza711,项目名称:pygal,代码行数:13,代码来源:test_pie.py

示例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()
开发者ID:AlanRun,项目名称:UiAutoTest,代码行数:13,代码来源:test_donut.py

示例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)
开发者ID:cleder,项目名称:pygal,代码行数:17,代码来源:test_donut.py

示例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)
开发者ID:cleder,项目名称:pygal,代码行数:18,代码来源:test_donut.py


注:本文中的pygal.Pie.title方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。