Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions py-scripts/artifacts/report.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 7 additions & 3 deletions py-scripts/lf_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,16 +313,18 @@ 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:
w = rect.get_width()
# 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:
Expand Down Expand Up @@ -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))
Expand Down
Loading