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


Python Line.render_sparktext方法代码示例

本文整理汇总了Python中pygal.Line.render_sparktext方法的典型用法代码示例。如果您正苦于以下问题:Python Line.render_sparktext方法的具体用法?Python Line.render_sparktext怎么用?Python Line.render_sparktext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pygal.Line的用法示例。


在下文中一共展示了Line.render_sparktext方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_no_data_sparktext

# 需要导入模块: from pygal import Line [as 别名]
# 或者: from pygal.Line import render_sparktext [as 别名]
def test_no_data_sparktext():
    """Test no data sparktext"""
    chart2 = Line()
    chart2.add('_', [])
    assert chart2.render_sparktext() == u('')

    chart3 = Line()
    assert chart3.render_sparktext() == u('')
开发者ID:aroraumang,项目名称:pygal,代码行数:10,代码来源:test_sparktext.py

示例2: test_another_sparktext

# 需要导入模块: from pygal import Line [as 别名]
# 或者: from pygal.Line import render_sparktext [as 别名]
def test_another_sparktext():
    chart = Line()
    chart.add('_', [0, 30, 55, 80, 33, 150])
    assert chart.render_sparktext() == u('▁▂▃▄▂█')
    assert chart.render_sparktext() == chart.render_sparktext()
    chart2 = Bar()
    chart2.add('_', [0, 30, 55, 80, 33, 150])
    assert chart2.render_sparktext() == chart.render_sparktext()
开发者ID:Bouska,项目名称:pygal,代码行数:10,代码来源:test_sparktext.py

示例3: test_same_max_and_relative_values_sparktext

# 需要导入模块: from pygal import Line [as 别名]
# 或者: from pygal.Line import render_sparktext [as 别名]
def test_same_max_and_relative_values_sparktext():
    chart = Line()
    chart.add('_', [0, 0, 0, 0, 0])
    assert chart.render_sparktext() == u('▁▁▁▁▁')

    chart2 = Line()
    chart2.add('_', [1, 1, 1, 1, 1])
    assert chart2.render_sparktext(relative_to=1) == u('▁▁▁▁▁')
开发者ID:AlanRun,项目名称:UiAutoTest,代码行数:10,代码来源:test_sparktext.py

示例4: test_another_sparktext

# 需要导入模块: from pygal import Line [as 别名]
# 或者: from pygal.Line import render_sparktext [as 别名]
def test_another_sparktext():
    """Test that same data produces same sparktext"""
    chart = Line()
    chart.add('_', [0, 30, 55, 80, 33, 150])
    assert chart.render_sparktext() == u('▁▂▃▄▂█')
    assert chart.render_sparktext() == chart.render_sparktext()
    chart2 = Bar()
    chart2.add('_', [0, 30, 55, 80, 33, 150])
    assert chart2.render_sparktext() == chart.render_sparktext()
开发者ID:aroraumang,项目名称:pygal,代码行数:11,代码来源:test_sparktext.py

示例5: test_negative_and_float_and_no_data_sparktext

# 需要导入模块: from pygal import Line [as 别名]
# 或者: from pygal.Line import render_sparktext [as 别名]
def test_negative_and_float_and_no_data_sparktext():
    chart = Line()
    chart.add('_', [0.1, 0.2, 0.9, -0.5])
    assert chart.render_sparktext() == u('▁▂█▁')

    chart2 = Line()
    chart2.add('_', [])
    assert chart2.render_sparktext() == u('')

    chart3 = Line()
    assert chart3.render_sparktext() == u('')
开发者ID:Bouska,项目名称:pygal,代码行数:13,代码来源:test_sparktext.py

示例6: test_negative_and_float__sparktext

# 需要导入模块: from pygal import Line [as 别名]
# 或者: from pygal.Line import render_sparktext [as 别名]
def test_negative_and_float__sparktext():
    """Test negative values"""
    """Test negative values"""
    chart = Line()
    chart.add('_', [0.1, 0.2, 0.9, -0.5])
    assert chart.render_sparktext() == u('▁▂█▁')
开发者ID:aroraumang,项目名称:pygal,代码行数:8,代码来源:test_sparktext.py

示例7: test_shifted_sparktext

# 需要导入模块: from pygal import Line [as 别名]
# 或者: from pygal.Line import render_sparktext [as 别名]
def test_shifted_sparktext():
    """Test relative_to option in sparktext"""
    chart = Line()
    chart.add('_', list(map(lambda x: x + 10000, range(8))))
    assert chart.render_sparktext() == u('▁▂▃▄▅▆▇█')
    assert chart.render_sparktext(relative_to=0) == u('▇▇▇▇▇▇▇█')
开发者ID:aroraumang,项目名称:pygal,代码行数:8,代码来源:test_sparktext.py

示例8: test_all_sparktext

# 需要导入模块: from pygal import Line [as 别名]
# 或者: from pygal.Line import render_sparktext [as 别名]
def test_all_sparktext():
    """Test all character sparktext"""
    chart = Line()
    chart.add('_', range(8))
    assert chart.render_sparktext() == u('▁▂▃▄▅▆▇█')
开发者ID:aroraumang,项目名称:pygal,代码行数:7,代码来源:test_sparktext.py

示例9: test_basic_sparktext

# 需要导入模块: from pygal import Line [as 别名]
# 或者: from pygal.Line import render_sparktext [as 别名]
def test_basic_sparktext():
    """Test basic sparktext"""
    chart = Line()
    chart.add('_', [1, 5, 22, 13, 53])
    assert chart.render_sparktext() == u('▁▁▃▂█')
开发者ID:aroraumang,项目名称:pygal,代码行数:7,代码来源:test_sparktext.py

示例10: test_all_sparktext

# 需要导入模块: from pygal import Line [as 别名]
# 或者: from pygal.Line import render_sparktext [as 别名]
def test_all_sparktext():
    chart = Line()
    chart.add('_', range(8))
    assert chart.render_sparktext() == u('▁▂▃▄▅▆▇█')
开发者ID:Bouska,项目名称:pygal,代码行数:6,代码来源:test_sparktext.py


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