aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2021-08-04 12:43:40 +0200
committerTibor Frank <tifrank@cisco.com>2021-08-04 13:05:31 +0000
commite93b9353fb0bcb86183944825239794cc03f6e23 (patch)
tree8c48bd9c944d180c600141627d0536f82d070c0e
parent7bfec3439e18be238403c20bfa80ff4b7540aac0 (diff)
Trending: Set y-axis for stats to zero
Change-Id: I5235d734d37709367c56878fffd3243aaba3f0b8 Signed-off-by: Tibor Frank <tifrank@cisco.com> (cherry picked from commit 8e1dfc4ab336302999f91ea0386093b0bc879974)
-rw-r--r--resources/tools/presentation/generator_plots.py7
-rw-r--r--resources/tools/presentation/specifications/trending/layouts.yaml1
2 files changed, 5 insertions, 3 deletions
diff --git a/resources/tools/presentation/generator_plots.py b/resources/tools/presentation/generator_plots.py
index f273aeb97b..1b95030818 100644
--- a/resources/tools/presentation/generator_plots.py
+++ b/resources/tools/presentation/generator_plots.py
@@ -193,9 +193,9 @@ def plot_statistics(plot, input_data):
logging.info(f" Writing the file {name_file}")
plpl = plgo.Figure(data=traces, layout=plot[u"layout"])
- tickvals = [min(data_y_duration), max(data_y_duration)]
- step = (tickvals[1] - tickvals[0]) / 6
- for i in range(6):
+ tickvals = [0, (max(data_y_duration) // 60) * 60]
+ step = tickvals[1] / 5
+ for i in range(5):
tickvals.append(int(tickvals[0] + step * (i + 1)))
plpl.update_layout(
yaxis2=dict(
@@ -203,6 +203,7 @@ def plot_statistics(plot, input_data):
anchor=u"x",
overlaying=u"y",
side=u"right",
+ rangemode="tozero",
tickmode=u"array",
tickvals=tickvals,
ticktext=[f"{(val // 60):02d}:{(val % 60):02d}" for val in tickvals]
diff --git a/resources/tools/presentation/specifications/trending/layouts.yaml b/resources/tools/presentation/specifications/trending/layouts.yaml
index aec150fd45..97dee3f9e2 100644
--- a/resources/tools/presentation/specifications/trending/layouts.yaml
+++ b/resources/tools/presentation/specifications/trending/layouts.yaml
@@ -22,6 +22,7 @@
tickcolor: "rgb(238, 238, 238)"
linewidth: 1
showgrid: True
+ rangemode: "tozero"
xaxis:
title: 'Date [MMDD]'
type: "date"