I applied the patch. Then I removed all the PNG files in the HTML 
directory, that they need to be re-created. Then I re-started WeeWX and 
waited for the next archive interval to come. I used Seasons skin.

There was no error message in syslog.

I checked all the plots in all time spans for their respective unit labels. 
All the unit labels were correct, including that of the radiation energy 
integral. 

Please, could you include "energy_integral" in the list in line 185 of 
imagegenerator.py together with "min", "max", and "avg" in order to put the 
point into the middle of the aggregation interval for that aggregation 
type, too?

Tom Keffer schrieb am Montag, 8. März 2021 um 20:38:58 UTC+1:

> Karen,
>
> Can you apply this simple patch to imagegenerator.py? Let me know if that 
> fixes the problem.
>
> diff --git a/bin/weewx/imagegenerator.py b/bin/weewx/imagegenerator.py
> index 4daae09a..0e33e40f 100644
> --- a/bin/weewx/imagegenerator.py
> +++ b/bin/weewx/imagegenerator.py
> @@ -196,7 +196,7 @@ class 
> ImageGenerator(weewx.reportengine.ReportGenerator):
>  
>                      # Add a unit label. NB: all will get overwritten 
> except the
>                      # last. Get the label from the configuration 
> dictionary.
> -                    unit_label = line_options.get('y_label', 
> weewx.units.get_label_string(self.formatter, self.converter, var_type))
> +                    unit_label = line_options.get('y_label', 
> self.formatter.get_label_string(new_data_vec_t[1]))
>                      # Strip off any leading and trailing whitespace so 
> it's
>                      # easy to center
>                      plot.setUnitLabel(unit_label.strip())
>
> -tk
>
> On Mon, Mar 8, 2021 at 10:20 AM Tom Keffer <[email protected]> wrote:
>
>> I've been able to confirm that this is a bug. Issue #654. 
>> <https://github.com/weewx/weewx/issues/654> 
>>
>> Thanks, Karen. I think this bug has survived all this time because plots 
>> of aggregation types that change the unit type are rare. XTypes are 
>> changing that.
>>
>>
>>
>> On Mon, Mar 8, 2021 at 5:52 AM Karen K <[email protected]> wrote:
>>
>>> Ah, ok, then. That is the section in skin.conf:
>>> [[[monthRadiationEnergy]]] 
>>>     line_gap_fraction = 0.04 
>>>     [[[[radiation]]]] 
>>>         label = "Sonnenenergie (täglich gesamt)" 
>>>         data_type = radiation 
>>>         aggregate_type = energy_integral 
>>>         aggregate_interval = 86400 
>>>
>>> Tom Keffer schrieb am Montag, 8. März 2021 um 14:33:49 UTC+1:
>>>
>>>> Yes, but I was thinking more in terms of the specification for the plot 
>>>> in skin.conf. What observation type did you say to plot? Are you 
>>>> accidentally plotting "radiation" instead of "energy_integral?"
>>>>
>>>> -tk
>>>>
>>>> On Mon, Mar 8, 2021 at 4:30 AM Karen K <[email protected]> wrote:
>>>>
>>>>> The database query I use is that:
>>>>> _result = db_manager.getSql( 
>>>>>     "SELECT SUM(radiation*interval)/60.0, " 
>>>>>     "MIN(usUnits),MAX(usUnits) FROM %s " 
>>>>>     "WHERE dateTime>? AND dateTime<=?" 
>>>>>     % db_manager.table_name,timespan) 
>>>>>
>>>>> -- 
>>>>>
>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "weewx-development" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to [email protected].
>>>>>
>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/weewx-development/ecc0844c-2061-4efb-8fd3-93a54f00936fn%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/weewx-development/ecc0844c-2061-4efb-8fd3-93a54f00936fn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "weewx-development" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-development/0cb6b4b7-1bab-46cc-9e6e-63ef47e28206n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/weewx-development/0cb6b4b7-1bab-46cc-9e6e-63ef47e28206n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/a1d0c101-6f55-45bc-afc2-ca09d6ca3d0en%40googlegroups.com.

Reply via email to