本文整理汇总了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;未经允许,请勿转载。 |
请发表评论