Report: Latency by Percentile Distribution
[csit.git] / resources / tools / presentation / generator_plots.py
index 8af9a94..4411ac8 100644 (file)
@@ -104,7 +104,7 @@ def plot_lat_hdrh_percentile(plot, input_data):
 
     # Prepare the data for the plot
     directions = [u"W-E", u"E-W"]
-    for test in data[0][0]:
+    for color, test in enumerate(data[0][0]):
         try:
             if test[u"type"] in (u"NDRPDR",):
                 if u"-pdr" in plot_title.lower():
@@ -137,7 +137,7 @@ def plot_lat_hdrh_percentile(plot, input_data):
                                 hovertext.append(
                                     f"Test: {name}<br>"
                                     f"Direction: {directions[idx]}<br>"
-                                    f"Percentile: {percentile:.5f}<br>%"
+                                    f"Percentile: {percentile:.5f}%<br>"
                                     f"Latency: {item.value_iterated_to}uSec"
                                 )
                         fig.add_trace(
@@ -146,6 +146,11 @@ def plot_lat_hdrh_percentile(plot, input_data):
                                 y=yaxis,
                                 name=name,
                                 mode=u"lines",
+                                legendgroup=name,
+                                showlegend=bool(idx),
+                                line=dict(
+                                    color=COLORS[color]
+                                ),
                                 hovertext=hovertext,
                                 hoverinfo=u"text"
                             )