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


Python XY.render_response方法代码示例

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

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

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

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

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

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


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