Only fetch last 100 cadence readings and display as sparklines graph
This commit is contained in:
8
graph.py
8
graph.py
@@ -26,3 +26,11 @@ def generate_graph(x_labels, data, style=custom_style):
|
||||
graph.add(title, values)
|
||||
graph_data = graph.render_data_uri()
|
||||
return graph_data
|
||||
|
||||
|
||||
def generate_sparkline_graph(data, style=custom_style):
|
||||
chart = pygal.Line(show_y_guides=False,
|
||||
show_legend=False, style=style)
|
||||
chart.add('', data)
|
||||
|
||||
return chart.render_sparkline(disable_xml_declaration=True)
|
||||
|
||||
Reference in New Issue
Block a user