diff options
author | Tibor Frank <tifrank@cisco.com> | 2022-05-02 10:39:24 +0200 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2022-05-03 09:51:18 +0000 |
commit | cd417be7f836eb9346fad4f87bd4f75dc1d9a429 (patch) | |
tree | eca75a80eabdfcb97c9eb0f2791197a7c13c987a /resources/tools/dash/app/pal/stats/graphs.py | |
parent | 54b40c5fbfa6102d3e71502ebcb9ca56cb5ef80c (diff) |
feat(uti): Add structured menu for stats
Change-Id: I907606b1b994e991975f887611750d23fd7f1634
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/dash/app/pal/stats/graphs.py')
-rw-r--r-- | resources/tools/dash/app/pal/stats/graphs.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/resources/tools/dash/app/pal/stats/graphs.py b/resources/tools/dash/app/pal/stats/graphs.py index 2fabf8e6ae..37fc1b2e73 100644 --- a/resources/tools/dash/app/pal/stats/graphs.py +++ b/resources/tools/dash/app/pal/stats/graphs.py @@ -40,8 +40,10 @@ def graph_statistics(df: pd.DataFrame, job:str, layout: dict, if data.empty: return None, None - x_axis = [d for d in data["start_time"] if d >= start and d <= end] - if not x_axis: + data = data.loc[( + (data["start_time"] >= start) & (data["start_time"] <= end) + )] + if data.empty: return None, None hover = list() @@ -62,7 +64,7 @@ def graph_statistics(df: pd.DataFrame, job:str, layout: dict, # Job durations: fig_duration = go.Figure( data=go.Scatter( - x=x_axis, + x=data["start_time"], y=data["duration"], name=u"Duration", text=hover, @@ -87,14 +89,14 @@ def graph_statistics(df: pd.DataFrame, job:str, layout: dict, fig_passed = go.Figure( data=[ go.Bar( - x=x_axis, + x=data["start_time"], y=data["passed"], name=u"Passed", hovertext=hover, hoverinfo=u"text" ), go.Bar( - x=x_axis, + x=data["start_time"], y=data["failed"], name=u"Failed", hovertext=hover, |