Exemplo n.º 1
0
def makegraphs():
    green = LEDController(led_pin=pins.GREEN_LED)
    green.on()

    pwgraphs.make_four_graphs(savefile=True)

    green.off()
Exemplo n.º 2
0
    def get_context_data(self, **kwargs):
        context = super(FourChartsDynamicView, self).get_context_data(**kwargs)
        fig = pwgraph.make_four_graphs()

        pngdata = StringIO.StringIO()
        fig.savefig(pngdata, format='png', facecolor='w', bbox_inches='tight')

        context['pngstr'] = base64.b64encode(pngdata.getvalue())
        return context
Exemplo n.º 3
0
    def get_context_data(self, **kwargs):
        context = super(FourChartsDynamicView, self).get_context_data(**kwargs)
        fig = pwgraph.make_four_graphs()

        pngdata = StringIO.StringIO()
        fig.savefig(pngdata, format='png', facecolor='w', bbox_inches='tight')


        context['pngstr'] = base64.b64encode(pngdata.getvalue())
        return context