diff --git a/py-scripts/artifacts/report.css b/py-scripts/artifacts/report.css index 03256161d..359a6279e 100644 --- a/py-scripts/artifacts/report.css +++ b/py-scripts/artifacts/report.css @@ -310,17 +310,16 @@ li { left: 0; width: 100%; } -#Banner { - background-image:url("banner.png"); - background-repeat:no-repeat; - padding: 0; - margin: 0 auto; - min-width: 1000px; - min-height: 205px; - width: 1000px; - height: 205px; - max-width: 1000px; - max-height: 205px; + #Banner { + background-image: url("banner.png"); + background-repeat: no-repeat; + background-size: cover; + background-position: bottom left; + padding: 0; + margin: 0 auto; + width: 90%; + height: 204px; + min-height: 204px; } #BannerLeft { diff --git a/py-scripts/lf_graph.py b/py-scripts/lf_graph.py index 7403501a7..0bfd53f64 100755 --- a/py-scripts/lf_graph.py +++ b/py-scripts/lf_graph.py @@ -313,6 +313,8 @@ def build_bar_graph_horizontal(self): else: yaxis_visable = True ax.yaxis.set_visible(yaxis_visable) + max_val = max(max(d) for d in self.data_set) if self.data_set else 1 + offset = max_val * 0.01 def show_value(rectangles): for rect in rectangles: @@ -320,9 +322,9 @@ def show_value(rectangles): # y = rect.get_y() # h = rect.get_height() # x = rect.get_x() - # adding 1 may not always work based on the x axis scale may need to be configurable - plt.text(w + 1, rect.get_y() + rect.get_height() / 4., w, - ha='center', va='bottom', rotation=self.text_rotation, fontsize=self.text_font) + # Use dynamic offset based on dataset scale for bar value positioning + plt.text(w + offset, rect.get_y() + rect.get_height() / 2., w, + ha='left', va='center', rotation=self.text_rotation, fontsize=self.text_font) br1 = None for _ in self.data_set: if i > 0: @@ -360,6 +362,8 @@ def show_value(rectangles): plt.suptitle(self.title, fontsize=self.title_size) plt.title(self.grp_title) plt.gcf() + # Expand x-axis so value labels outside bars fit + plt.xlim(0, max_val * 1.1) plt.savefig("%s.png" % self.graph_image_name, dpi=96) plt.close() logger.debug("{}.png".format(self.graph_image_name))