mirror of
https://github.com/weewx/weewx.git
synced 2026-05-19 15:25:32 -04:00
Branch to experiment with a different way of tracking units
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user