cmon in 2.6.0a6

26 views
Skip to first unread message

Vince Skahan

unread,
Jan 31, 2014, 12:50:09 PM1/31/14
to weewx-de...@googlegroups.com
Matthew - check out the x-axis on http://www.skahan.net/weewx/cmon - see everything shows %.0f ?

There are a couple other things wrong that are tweaks I need to do:
 - Tom already posted a spacing patch
 - the y-axis overflows to the left, I need to tune my skin.conf a little bit there

mwall

unread,
Jan 31, 2014, 1:06:41 PM1/31/14
to weewx-de...@googlegroups.com

the cmon skin is intentionally barebones, however this seems to be exposing some assumptions in genplot.

genplot determines left margin using a simple multiplier instead of measuring font metrics.

it looks like genplot defaults to %0.f when no label format is specified.

m

mwall

unread,
Jan 31, 2014, 1:36:25 PM1/31/14
to weewx-de...@googlegroups.com
On Friday, January 31, 2014 12:50:09 PM UTC-5, Vince Skahan wrote:
Matthew - check out the x-axis on http://www.skahan.net/weewx/cmon - see everything shows %.0f ?

adding this method to TimePlot in genplot.py should fix it:

    def _calcXLabelFormat(self):
        """Specialized version for time plots."""
        if self.x_label_format is None:
            (xmin, xmax) = self._calcXMinMax()
            delta = xmax - xmin
            if delta > 30*24*3600:
                self.x_label_format = "%m/%d"
            elif delta > 24*3600:
                self.x_label_format = '%d'
            else:
                self.x_label_format = '%H:%M'

however, i'm sure there is a generalized form that automatically picks up any localization...

same for the default bottom_label in imagegenerator.py

Reply all
Reply to author
Forward
0 new messages