Report: Fix NFV Graphs
[csit.git] / resources / tools / presentation / generator_plots.py
index 113e435..56b9a89 100644 (file)
@@ -1431,10 +1431,10 @@ def plot_service_density_heatmap_compare(plot, input_data):
                         if groups and len(groups.groups()) == 3:
                             if str(groups.group(3)) == \
                                     plot["reference"]["include"]:
-                                vals[c][n]["vals_c"].append(result)
+                                vals[c][n]["vals_r"].append(result)
                             elif str(groups.group(3)) == \
                                     plot["compare"]["include"]:
-                                vals[c][n]["vals_r"].append(result)
+                                vals[c][n]["vals_c"].append(result)
                             break
     if not vals:
         logging.error("No data.")
@@ -1551,6 +1551,8 @@ def plot_service_density_heatmap_compare(plot, input_data):
                         nr_c=vals[txt_chains[c]][txt_nodes[n]]["nr_c"]
                     ) if data_c[c][n] is not None else "Test Failed",
                     text_diff=text_diff.format(
+                        title_r=plot["reference"]["name"],
+                        title_c=plot["compare"]["name"],
                         diff=diff[c][n]
                     ) if diff[c][n] is not None else ""
                 ))
@@ -1610,7 +1612,9 @@ def plot_service_density_heatmap_compare(plot, input_data):
                      name="Diff",
                      visible=False,
                      colorbar=dict(
-                         title="Relative difference [%]",
+                         title="Relative Difference {name_c} vs. {name_r} [%]".
+                             format(name_c=plot["compare"]["name"],
+                                    name_r=plot["reference"]["name"]),
                          titleside="right",
                          titlefont=dict(
                              size=16