mirror of https://github.com/snachodog/mybuddy.git
Add duration figures to graph view for sleep totals.
This commit is contained in:
parent
f4d94a3ca0
commit
e73cb380ef
|
@ -12,7 +12,7 @@ import plotly.offline as plotly
|
||||||
import plotly.graph_objs as go
|
import plotly.graph_objs as go
|
||||||
|
|
||||||
from core.models import DiaperChange, Sleep
|
from core.models import DiaperChange, Sleep
|
||||||
from core.utils import duration_string
|
from core.utils import duration_string, duration_string_short
|
||||||
|
|
||||||
from .utils import default_graph_layout_options, split_graph_output
|
from .utils import default_graph_layout_options, split_graph_output
|
||||||
|
|
||||||
|
@ -85,7 +85,8 @@ def sleep_totals(child):
|
||||||
x=list(totals.keys()),
|
x=list(totals.keys()),
|
||||||
y=[td.seconds/3600 for td in totals.values()],
|
y=[td.seconds/3600 for td in totals.values()],
|
||||||
hoverinfo='text',
|
hoverinfo='text',
|
||||||
text=[duration_string(td) for td in totals.values()]
|
textposition='outside',
|
||||||
|
text=[duration_string_short(td) for td in totals.values()]
|
||||||
)
|
)
|
||||||
|
|
||||||
layout_args = default_graph_layout_options()
|
layout_args = default_graph_layout_options()
|
||||||
|
|
Loading…
Reference in New Issue