improve the plots
This commit is contained in:
parent
57c9adfa4d
commit
c8906fdbdc
|
@ -4,7 +4,7 @@ from collector.models import Time, Temperature, Humidity, Pressure
|
|||
|
||||
|
||||
def temperature():
|
||||
data = Temperature.objects.all()[:30]
|
||||
data = Temperature.objects.all()[30:]
|
||||
x_axis = []
|
||||
y_axis = []
|
||||
for point in data:
|
||||
|
@ -13,13 +13,14 @@ def temperature():
|
|||
|
||||
plot_div = plot([Scatter(x=x_axis , y=y_axis,
|
||||
mode='lines', name='temperature',
|
||||
opacity=0.8, marker_color='green')],
|
||||
opacity=0.8, marker_color='green',
|
||||
line_shape='spline')],
|
||||
output_type='div')
|
||||
return plot_div
|
||||
|
||||
|
||||
def humidity():
|
||||
data = Humidity.objects.all()[:30]
|
||||
data = Humidity.objects.all()[30:]
|
||||
x_axis = []
|
||||
y_axis = []
|
||||
for point in data:
|
||||
|
@ -28,13 +29,14 @@ def humidity():
|
|||
|
||||
plot_div = plot([Scatter(x=x_axis , y=y_axis,
|
||||
mode='lines', name='humidity',
|
||||
opacity=0.8, marker_color='green')],
|
||||
opacity=0.8, marker_color='green',
|
||||
line_shape='spline')],
|
||||
output_type='div')
|
||||
return plot_div
|
||||
|
||||
|
||||
def pressure():
|
||||
data = Pressure.objects.all()[:30]
|
||||
data = Pressure.objects.all()[30:]
|
||||
x_axis = []
|
||||
y_axis = []
|
||||
for point in data:
|
||||
|
@ -43,6 +45,7 @@ def pressure():
|
|||
|
||||
plot_div = plot([Scatter(x=x_axis , y=y_axis,
|
||||
mode='lines', name='pressure',
|
||||
opacity=0.8, marker_color='green')],
|
||||
opacity=0.8, marker_color='green',
|
||||
line_shape='spline')],
|
||||
output_type='div')
|
||||
return plot_div
|
||||
|
|
Loading…
Reference in New Issue