本文整理汇总了Python中pygal.XY.render_response方法的典型用法代码示例。如果您正苦于以下问题:Python XY.render_response方法的具体用法?Python XY.render_response怎么用?Python XY.render_response使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pygal.XY
的用法示例。
在下文中一共展示了XY.render_response方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_xy_links
# 需要导入模块: from pygal import XY [as 别名]
# 或者: from pygal.XY import render_response [as 别名]
def test_xy_links():
xy = XY(style=styles['neon'], interpolate='cubic')
xy.add(
'1234', [{
'value': (10, 5),
'label': 'Ten',
'xlink': 'http://google.com?q=10'
}, {
'value': (20, 20),
'tooltip': 'Twenty',
'xlink': 'http://google.com?q=20'
}, (30, 15), {
'value': (40, -5),
'label': 'Forty',
'xlink': 'http://google.com?q=40'
}]
)
xy.add(
'4321', [(40, 10), {
'value': (30, 3),
'label': 'Thirty',
'xlink': 'http://google.com?q=30'
}, (20, 10), (10, 21)]
)
xy.x_labels = list(range(1, 50))
xy.y_labels = list(range(1, 50))
return xy.render_response()
示例2: test_secondary_xy
# 需要导入模块: from pygal import XY [as 别名]
# 或者: from pygal.XY import render_response [as 别名]
def test_secondary_xy():
chart = XY()
chart.add(10 * '1', [(30, 5), (20, 12), (25, 4)])
chart.add(10 * '1b', [(4, 12), (5, 8), (6, 4)], secondary=True)
chart.add(10 * '2b', [(3, 24), (0, 17), (12, 9)], secondary=True)
chart.add(10 * '2', [(8, 23), (21, 1), (5, 0)])
return chart.render_response()
示例3: test_secondary_xy
# 需要导入模块: from pygal import XY [as 别名]
# 或者: from pygal.XY import render_response [as 别名]
def test_secondary_xy():
chart = XY()
chart.add(10 * '1', [(30, 5), (20, 12), (25, 4)])
chart.add(10 * '1b', [(4, 12), (5, 8), (6, 4)], secondary=True)
chart.add(10 * '2b', [(3, 24), (0, 17), (12, 9)], secondary=True)
chart.add(10 * '2', [(8, 23), (21, 1), (5, 0)])
chart.value_formatter = lambda x: str(int(x)) + '+'
return chart.render_response()
示例4: test_xy_links
# 需要导入模块: from pygal import XY [as 别名]
# 或者: from pygal.XY import render_response [as 别名]
def test_xy_links():
xy = XY(style=styles["neon"])
xy.add(
"1234",
[
{"value": (10, 5), "label": "Ten", "xlink": "http://google.com?q=10"},
{"value": (20, 20), "tooltip": "Twenty", "xlink": "http://google.com?q=20"},
(30, 15),
{"value": (40, -5), "label": "Forty", "xlink": "http://google.com?q=40"},
],
)
xy.add(
"4321",
[(40, 10), {"value": (30, 3), "label": "Thirty", "xlink": "http://google.com?q=30"}, (20, 10), (10, 21)],
)
xy.x_labels = map(str, range(1, 5))
return xy.render_response()
示例5: test_fill_with_none
# 需要导入模块: from pygal import XY [as 别名]
# 或者: from pygal.XY import render_response [as 别名]
def test_fill_with_none():
graph = XY(fill=True)
graph.add('1', [(1, 2), (3, 3), (3.5, 5), (5, 1)])
graph.add('2', [(1, 9), (None, 5), (5, 23)])
return graph.render_response()
示例6: test_xy_single
# 需要导入模块: from pygal import XY [as 别名]
# 或者: from pygal.XY import render_response [as 别名]
def test_xy_single():
graph = XY(interpolate='cubic')
graph.add('Single', [(1, 1)])
return graph.render_response()