mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 19:28:00 +00:00
font-szie and rotation for text above the bargraph is added
This commit is contained in:
@@ -50,6 +50,8 @@ class lf_bar_graph():
|
|||||||
_show_bar_value=False,
|
_show_bar_value=False,
|
||||||
_xaxis_step=5,
|
_xaxis_step=5,
|
||||||
_xticks_font = None,
|
_xticks_font = None,
|
||||||
|
_text_font=None,
|
||||||
|
_text_rotation=None,
|
||||||
_grp_title = "",
|
_grp_title = "",
|
||||||
_dpi=96,
|
_dpi=96,
|
||||||
_enable_csv=False):
|
_enable_csv=False):
|
||||||
@@ -72,6 +74,8 @@ class lf_bar_graph():
|
|||||||
self.show_bar_value = _show_bar_value
|
self.show_bar_value = _show_bar_value
|
||||||
self.xaxis_step = _xaxis_step
|
self.xaxis_step = _xaxis_step
|
||||||
self.xticks_font = _xticks_font
|
self.xticks_font = _xticks_font
|
||||||
|
self.text_font = _text_font
|
||||||
|
self.text_rotation = _text_rotation
|
||||||
self.grp_title = _grp_title
|
self.grp_title = _grp_title
|
||||||
self.enable_csv = _enable_csv
|
self.enable_csv = _enable_csv
|
||||||
self.lf_csv = LfCSV()
|
self.lf_csv = LfCSV()
|
||||||
@@ -90,8 +94,8 @@ class lf_bar_graph():
|
|||||||
def show_value(rects):
|
def show_value(rects):
|
||||||
for rect in rects:
|
for rect in rects:
|
||||||
h = rect.get_height()
|
h = rect.get_height()
|
||||||
plt.text(rect.get_x() + rect.get_width() / 2., h + 0.05, '%d' % int(h),
|
plt.text(rect.get_x() + rect.get_width() / 2., h, h,
|
||||||
ha='center', va='bottom')
|
ha='center', va='bottom', rotation=self.text_rotation, fontsize=self.text_font)
|
||||||
|
|
||||||
for data in self.data_set:
|
for data in self.data_set:
|
||||||
if i > 0:
|
if i > 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user