Exemple #1
0
 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()
Exemple #2
0
 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()
Exemple #3
0
    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()
Exemple #4
0
 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()
Exemple #5
0
 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()
Exemple #6
0
    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()
Exemple #7
0
    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()
Exemple #8
0
 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()
Exemple #9
0
 def test_xy_single():
     graph = XY(interpolate='cubic')
     graph.add('Single', [(1, 1)])
     return graph.render_response()
Exemple #10
0
 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()
Exemple #11
0
 def test_xy_single():
     graph = XY(interpolate='cubic')
     graph.add('Single', [(1, 1)])
     return graph.render_response()
Exemple #12
0
 def test_xy_single():
     graph = XY(interpolate="cubic")
     graph.add("Single", [(1, 1)])
     return graph.render_response()