diff options
Diffstat (limited to 'dash/pages/locations.py')
-rw-r--r-- | dash/pages/locations.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/dash/pages/locations.py b/dash/pages/locations.py index 9125ba0..13aa752 100644 --- a/dash/pages/locations.py +++ b/dash/pages/locations.py @@ -10,6 +10,7 @@ import plotly.graph_objects as go import datetime as dt from natsort import natsorted +from prettytime import prettytime import db from app import app @@ -89,7 +90,7 @@ def make_content_all(days, date): figure.add_trace(go.Pie( labels=[item['locationname'][0:9] for item in data if item['ip'] == sat], values=[item['totalSessionTime'] for item in data if item['ip'] == sat], - text=[str(int(item['totalSessionTime'] / 3600)) + ' h' for item in data if item['ip'] == sat], + text=[prettytime(item['totalSessionTime']) for item in data if item['ip'] == sat], hole=0.3, textinfo='none', hoverinfo='label+text+percent', |