• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python test.make_data函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pygal.test.make_data函数的典型用法代码示例。如果您正苦于以下问题:Python make_data函数的具体用法?Python make_data怎么用?Python make_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: test_cubic_prec

def test_cubic_prec(Chart, datas):
    chart = Chart(interpolate='cubic', interpolation_precision=200)
    chart = make_data(chart, datas)

    chart_low = Chart(interpolate='cubic', interpolation_precision=5)
    chart_low = make_data(chart, datas)

    assert len(chart.render()) >= len(chart_low.render())
开发者ID:langelee,项目名称:pygal,代码行数:8,代码来源:test_interpolate.py


示例2: test_cubic_prec

def test_cubic_prec(Chart, datas):
    """Test cubic interpolation precision"""
    chart = Chart(interpolate="cubic", interpolation_precision=200)
    chart = make_data(chart, datas)

    chart_low = Chart(interpolate="cubic", interpolation_precision=5)
    chart_low = make_data(chart, datas)

    assert len(chart.render()) >= len(chart_low.render())
开发者ID:ConnorMooreLUC,项目名称:pygal,代码行数:9,代码来源:test_interpolate.py


示例3: test_multi_render

def test_multi_render(Chart, datas):
    """Check that a chart always render the same"""
    chart = Chart()
    chart = make_data(chart, datas)
    svg = chart.render()
    for i in range(2):
        assert svg == chart.render()
开发者ID:ConnorMooreLUC,项目名称:pygal,代码行数:7,代码来源:test_graph.py


示例4: test_hermite_kochanek_bartels

def test_hermite_kochanek_bartels(Chart, datas):
    chart = Chart(interpolate="hermite", interpolation_parameters={"type": "kochanek_bartels", "b": -1, "c": 1, "t": 1})
    chart = make_data(chart, datas)
    assert chart.render()

    chart = Chart(
        interpolate="hermite", interpolation_parameters={"type": "kochanek_bartels", "b": -1, "c": -8, "t": 0}
    )
    chart = make_data(chart, datas)
    assert chart.render()

    chart = Chart(
        interpolate="hermite", interpolation_parameters={"type": "kochanek_bartels", "b": 0, "c": 10, "t": -1}
    )
    chart = make_data(chart, datas)
    assert chart.render()
开发者ID:jespinoza711,项目名称:pygal,代码行数:16,代码来源:test_interpolate.py


示例5: test_hermite_finite

def test_hermite_finite(Chart, datas):
    """Test hermite finite difference interpolation"""
    chart = Chart(
        interpolate='hermite',
        interpolation_parameters={'type': 'finite_difference'}
    )
    chart = make_data(chart, datas)
    assert chart.render()
开发者ID:Kozea,项目名称:pygal,代码行数:8,代码来源:test_interpolate.py


示例6: test_multi_render

def test_multi_render(Chart, datas):
    chart = Chart()
    chart = make_data(chart, datas)
    chart.x_labels = (str(a) for a in 'labels')
    chart.y_labels = (str(a) for a in range(6))
    svg = chart.render()
    for i in range(2):
        assert svg == chart.render()
开发者ID:imclab,项目名称:pygal,代码行数:8,代码来源:test_graph.py


示例7: test_hermite_catmull_rom

def test_hermite_catmull_rom(Chart, datas):
    """Test hermite catmull rom interpolation"""
    chart = Chart(
        interpolate='hermite',
        interpolation_parameters={'type': 'catmull_rom'}
    )
    chart = make_data(chart, datas)
    assert chart.render()
开发者ID:Kozea,项目名称:pygal,代码行数:8,代码来源:test_interpolate.py


示例8: test_hermite_kochanek_bartels

def test_hermite_kochanek_bartels(Chart, datas):
    chart = Chart(interpolate='hermite',
                  interpolation_parameters={
                      'type': 'kochanek_bartels', 'b': -1, 'c': 1, 't': 1})
    chart = make_data(chart, datas)
    assert chart.render()

    chart = Chart(interpolate='hermite',
                  interpolation_parameters={
                      'type': 'kochanek_bartels', 'b': -1, 'c': -8, 't': 0})
    chart = make_data(chart, datas)
    assert chart.render()

    chart = Chart(interpolate='hermite',
                  interpolation_parameters={
                      'type': 'kochanek_bartels', 'b': 0, 'c': 10, 't': -1})
    chart = make_data(chart, datas)
    assert chart.render()
开发者ID:langelee,项目名称:pygal,代码行数:18,代码来源:test_interpolate.py


示例9: test_long_title

def test_long_title(Chart, datas):
    chart = Chart(
        title="A chart is a graphical representation of data, in which "
        "'the data is represented by symbols, such as bars in a bar chart, "
        "lines in a line chart, or slices in a pie chart'. A chart can "
        "represent tabular numeric data, functions or some kinds of "
        "qualitative structure and provides different info.")
    chart = make_data(chart, datas)
    q = chart.render_pyquery()
    assert len(q('.titles text')) == 5
开发者ID:imclab,项目名称:pygal,代码行数:10,代码来源:test_graph.py


示例10: test_render_to_file

def test_render_to_file(Chart, datas):
    file_name = '/tmp/test_graph-%s.svg' % uuid.uuid4()
    if os.path.exists(file_name):
        os.remove(file_name)

    chart = Chart()
    chart = make_data(chart, datas)
    chart.render_to_file(file_name)
    with open(file_name) as f:
        assert 'pygal' in f.read()
    os.remove(file_name)
开发者ID:Bouska,项目名称:pygal,代码行数:11,代码来源:test_graph.py


示例11: test_hermite_cardinal

def test_hermite_cardinal(Chart, datas):
    """Test hermite cardinal interpolation"""
    chart = Chart(
        interpolate='hermite',
        interpolation_parameters={
            'type': 'cardinal',
            'c': .75
        }
    )
    chart = make_data(chart, datas)
    assert chart.render()
开发者ID:Kozea,项目名称:pygal,代码行数:11,代码来源:test_interpolate.py


示例12: test_render_to_file

def test_render_to_file(Chart, datas):
    """Test in file rendering"""
    file_name = '/tmp/test_graph-%s.svg' % uuid.uuid4()
    if os.path.exists(file_name):
        os.remove(file_name)

    chart = Chart()
    chart = make_data(chart, datas)
    chart.render_to_file(file_name)
    with io.open(file_name, encoding="utf-8") as f:
        assert 'pygal' in f.read()
    os.remove(file_name)
开发者ID:ConnorMooreLUC,项目名称:pygal,代码行数:12,代码来源:test_graph.py


示例13: test_render_to_png

def test_render_to_png(Chart, datas):
    file_name = '/tmp/test_graph-%s.png' % uuid.uuid4()
    if os.path.exists(file_name):
        os.remove(file_name)

    chart = Chart()
    chart = make_data(chart, datas)
    chart.render_to_png(file_name)
    png = chart._repr_png_()

    with open(file_name, 'rb') as f:
        assert png == f.read()
    os.remove(file_name)
开发者ID:imclab,项目名称:pygal,代码行数:13,代码来源:test_graph.py


示例14: test_render_to_png

def test_render_to_png(Chart, datas):
    try:
        import cairosvg
    except ImportError:
        return

    file_name = '/tmp/test_graph-%s.png' % uuid.uuid4()
    if os.path.exists(file_name):
        os.remove(file_name)

    chart = Chart()
    chart = make_data(chart, datas)
    chart.render_to_png(file_name)
    with open(file_name, 'rb') as f:
        assert f.read()
    os.remove(file_name)
开发者ID:Bouska,项目名称:pygal,代码行数:16,代码来源:test_graph.py


示例15: test_cubic

def test_cubic(Chart, datas):
    chart = Chart(interpolate='cubic')
    chart = make_data(chart, datas)
    assert chart.render()
开发者ID:langelee,项目名称:pygal,代码行数:4,代码来源:test_interpolate.py


示例16: test_sparkline

def test_sparkline(Chart, datas):
    """Test sparkline"""
    chart = Chart()
    chart = make_data(chart, datas)
    assert chart.render_sparkline()
开发者ID:ConnorMooreLUC,项目名称:pygal,代码行数:5,代码来源:test_graph.py


示例17: test_quadratic

def test_quadratic(Chart, datas):
    chart = Chart(interpolate='quadratic')
    chart = make_data(chart, datas)
    assert chart.render()
开发者ID:langelee,项目名称:pygal,代码行数:4,代码来源:test_interpolate.py


示例18: test_multi_render

def test_multi_render(Chart, datas):
    chart = Chart()
    chart = make_data(chart, datas)
    svg = chart.render()
    for i in range(2):
        assert svg == chart.render()
开发者ID:Bouska,项目名称:pygal,代码行数:6,代码来源:test_graph.py


示例19: test_trigonometric

def test_trigonometric(Chart, datas):
    chart = Chart(interpolate='trigonometric')
    chart = make_data(chart, datas)
    assert chart.render()
开发者ID:langelee,项目名称:pygal,代码行数:4,代码来源:test_interpolate.py


示例20: test_lagrange

def test_lagrange(Chart, datas):
    """Test lagrange interpolation"""
    chart = Chart(interpolate="lagrange")
    chart = make_data(chart, datas)
    assert chart.render()
开发者ID:ConnorMooreLUC,项目名称:pygal,代码行数:5,代码来源:test_interpolate.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python util.alter函数代码示例发布时间:2022-05-25
下一篇:
Python svg.Svg类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap