Esempio n. 1
0
    # Generate graph

    graph = graphs.find({'location': location}).sort("key", pymongo.ASCENDING)
    obj = loads(dumps(graph))

    config = Config()
    config.show_legend = False
    config.fill = True
    config.style = LightGreenStyle
    config.x_label_rotation = 80
    config.show_only_major_dots = True
    config.x_labels_major_every = 2
    config.show_minor_x_labels = False
    config.show_minor_y_labels = False
    config.major_label_font_size = 12
    config.print_values = False
    config.print_zeroes = True
    config.disable_xml_declaration = True
    chart = pygal.Line(config)

    t = []
    p = []
    for l in obj:
        tt = l.get('displayTime')
        if tt.startswith('0'):
            tt = tt[1:]
        t.append(tt)
        p.append(int(l.get('people')))
    chart.x_labels = t
    chart.add('People', p)
Esempio n. 2
0
global sender
global receivers

sender = 'Monito admin <*****@*****.**>'
receivers = ['*****@*****.**']

config = Config()
config.range=(.0001, 5)
config.legend_font_size=30
config.tooltip_font_size=30
config.legend_box_size=18
config.title_font_size=30
config.label_font_size=20
config.legend_at_bottom=True
config.major_label_font_size=20
config.no_data_text='Fetching data..'

config1 = Config()
config1.fill=True
config1.spacing=50
config1.range=(1, 100)
config1.legend_font_size=30
config1.tooltip_font_size=30
config1.legend_box_size=18
config1.title_font_size=30
config1.label_font_size=20
config1.legend_at_bottom=True
config1.major_label_font_size=20
config1.no_data_text='Fetching data..'