def monthly_max_temps_box(monthlies, append_title=""):
    """
    Given `monthlies` data as returned by `aggregate_monthly_data()`,
    returns a Pygal box-and-whisker plot graph of the range of high
    temperatures for each month.
    """

    graph = Box(title="High Temperature Ranges" + append_title,
                show_legend=False, x_labels=MONTH_NAMES, x_label_rotation=90,
                y_title=u"\u00b0C")

    for i, month_name in enumerate(MONTH_NAMES):
        graph.add(month_name, monthlies[i]['all_max_temperatures'])

    return graph
Example #2
0
 def test_box():
     chart = Box()
     chart.js = ('http://l:2343/2.0.x/pygal-tooltips.js',)
     chart.box_mode = '1.5IQR'
     chart.add('One', [15, 8, 2, -12, 9, 23])
     chart.add('Two', [5, 8, 2, -9, 23, 12])
     chart.add('Three', [8, -2, 12, -5, 9, 3])
     chart.add('Four', [5, 8, 2, -9, -3, 12])
     chart.add('Five', [8, 12, 12, -9, 5, 13])
     chart.x_labels = map(str, range(5))
     return chart.render_response()
Example #3
0
 def test_box():
     chart = Box()
     chart.add('One', [15, 8, 2, -12, 9, 23])
     chart.add('Two', [5, 8, 2, -9, 23, 12])
     chart.add('Three', [8, -2, 12, -5, 9, 3])
     chart.add('Four', [5, 8, 2, -9, -3, 12])
     chart.add('Five', [8, 12, 12, -9, 5, 13])
     chart.x_labels = map(str, range(5))
     return chart.render_response()
Example #4
0
 def test_box():
     chart = Box()
     chart.js = ("http://l:2343/2.0.x/pygal-tooltips.js",)
     chart.box_mode = "1.5IQR"
     chart.add("One", [15, 8, 2, -12, 9, 23])
     chart.add("Two", [5, 8, 2, -9, 23, 12])
     chart.add("Three", [8, -2, 12, -5, 9, 3])
     chart.add("Four", [5, 8, 2, -9, -3, 12])
     chart.add("Five", [8, 12, 12, -9, 5, 13])
     chart.x_labels = map(str, range(5))
     return chart.render_response()
Example #5
0
 def test_box():
     chart = Box()
     chart.js = ('http://l:2343/2.0.x/pygal-tooltips.js', )
     chart.box_mode = '1.5IQR'
     chart.add('One', [15, 8, 2, -12, 9, 23])
     chart.add('Two', [5, 8, 2, -9, 23, 12])
     chart.add('Three', [8, -2, 12, -5, 9, 3])
     chart.add('Four', [5, 8, 2, -9, -3, 12])
     chart.add('Five', [8, 12, 12, -9, 5, 13])
     chart.x_labels = map(str, range(5))
     return chart.render_response()
Example #6
0
 def test_box():
     chart = Box()
     chart.add("One", [15, 8, 2, -12, 9, 23])
     chart.add("Two", [5, 8, 2, -9, 23, 12])
     chart.add("Three", [8, -2, 12, -5, 9, 3])
     chart.add("Four", [5, 8, 2, -9, -3, 12])
     chart.add("Five", [8, 12, 12, -9, 5, 13])
     chart.x_labels = map(str, range(5))
     return chart.render_response()
Example #7
0
 def test_box():
     chart = Box()
     chart.add('One', [15, 8, 2, -12, 9, 23])
     chart.add('Two', [5, 8, 2, -9, 23, 12])
     chart.add('Three', [8, -2, 12, -5, 9, 3])
     chart.add('Four', [5, 8, 2, -9, -3, 12])
     chart.add('Five', [8, 12, 12, -9, 5, 13])
     chart.x_labels = map(str, range(5))
     return chart.render_response()