Branch to experiment with a different way of tracking units

This commit is contained in:
Tom Keffer
2010-04-05 22:42:24 +00:00
parent c274ce8302
commit d6f8378f77
42 changed files with 4676 additions and 3116 deletions

View File

@@ -55,7 +55,7 @@ class GeneralPlot(object):
self.top_label_font_path = config_dict.get('top_label_font_path')
self.top_label_font_size = int(config_dict.get('top_label_font_size', 10))
self.unit_label = None
self.unit_label_dict = None
self.unit_label_font_path = config_dict.get('unit_label_font_path')
self.unit_label_font_color = int(config_dict.get('unit_label_font_color', '0x000000'), 0)
self.unit_label_font_size = int(config_dict.get('unit_label_font_size', 10))
@@ -96,7 +96,7 @@ class GeneralPlot(object):
"""Set the label to be used to show the units of the plot.
"""
self.unit_label = unit_label
self.unit_label_dict = unit_label
def setXScaling(self, xscale):
"""Set the X scaling.
@@ -277,9 +277,9 @@ class GeneralPlot(object):
# Put the units in the upper left corner
unit_label_font = weeutil.weeutil.get_font_handle(self.unit_label_font_path, self.unit_label_font_size)
if self.unit_label:
if self.unit_label_dict:
draw.text(self.unit_label_position,
self.unit_label,
self.unit_label_dict,
fill=self.unit_label_font_color, font=unit_label_font)
top_label_font = weeutil.weeutil.get_font_handle(self.top_label_font_path, self.top_label_font_size)