Example #1
0
def test_render():
    """Tests that a gauge plots"""
    chart = Gauge()
    chart.range = [0,40]
    chart.add('Connor', 21)
    chart.add('Mike', 30)
    chart.add('Jules', 10)
    assert chart.render()
Example #2
0
    def test_gauge():
        gauge = Gauge()

        gauge.range = [-10, 10]
        gauge.add('Need l', [2.3, 5.12])
        gauge.add('No', [99, -99])
        return gauge.render_response()
Example #3
0
    def test_gauge():
        gauge = Gauge()

        gauge.range = [-10, 10]
        gauge.add('Need l', [2.3, 5.12])
        gauge.add('No', [99, -99])
        return gauge.render_response()
Example #4
0
    def test_bar_links():
        bar = Gauge(style=styles['neon'])
        bar.add('1234', [
            {'value': 10,
             'label': 'Ten',
             'xlink': 'http://google.com?q=10'},
            {'value': 20,
             'label': 'Twenty',
             'xlink': 'http://google.com?q=20'},
            30,
            {'value': 40,
             'label': 'Forty',
             'xlink': 'http://google.com?q=40'}
        ])

        bar.add('4321', [40, {
            'value': 30,
            'label': 'Thirty',
            'xlink': 'http://google.com?q=30'
        }, 20, 10])
        bar.x_labels = map(str, range(1, 5))
        bar.logarithmic = True
        bar.zero = 1
        return bar.render_response()
Example #5
0
    def test_gauge_log():
        gauge = Gauge(logarithmic=True)

        gauge.add('Need l', [200.3, 500.12])
        gauge.add('Need z', [10, 1000.5])
        return gauge.render_response()
Example #6
0
    def test_gauge():
        gauge = Gauge()

        gauge.range = [-10, 10]
        gauge.add('Need l', [2.3, 5.12])
        gauge.add('Need m', [-4])
        gauge.add('Need z', [-10, 10.5])
        gauge.add('No', [99, -99])
        gauge.y_labels = [
            {'label': 'X',
             'value': 6},
            {'label': '><',
             'value': -6}
        ]
        return gauge.render_response()
Example #7
0
    def test_gauge_log():
        gauge = Gauge(logarithmic=True)

        gauge.add('Need l', [200.3, 500.12])
        gauge.add('Need z', [10, 1000.5])
        return gauge.render_response()
Example #8
0
    def test_gauge():
        gauge = Gauge()

        gauge.range = [-10, 10]
        gauge.add('Need l', [2.3, 5.12])
        gauge.add('Need m', [-4])
        gauge.add('Need z', [-10, 10.5])
        gauge.add('No', [99, -99])
        gauge.y_labels = [{
            'label': 'X',
            'value': 6
        }, {
            'label': '><',
            'value': -6
        }]
        return gauge.render_response()
Example #9
0
    def test_gauge():
        gauge = Gauge()

        gauge.range = [-10, 10]
        gauge.add("Need l", [2.3, 5.12])
        gauge.add("Need m", [-4])
        gauge.add("Need z", [-10, 10.5])
        gauge.add("No", [99, -99])
        gauge.y_labels = [{"label": "X", "value": 6}, {"label": "><", "value": -6}]
        return gauge.render_response()