Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added chart option "unit" for special target units #773

Merged
merged 2 commits into from
May 15, 2022

Conversation

roe-dl
Copy link
Contributor

@roe-dl roe-dl commented Mar 24, 2022

I missed an option to set the target unit for an observation type in graphs.conf. So I would like to introduce a new option units that allows to set the unit individually for each chart. That comes in useful if you want to show graphs for summarized readings with an unit starting with "kilo" or "mega" for long time periods (month, year), but use the base unit for short time periods (day, week, may be). Using that option converts the values of the chart line it is specified for to the given target unit and sets the unit label appropriately. I hope that will be useful to other users, too.

Typical units for that would be watt_hour and kilowatt_hour or watt_hour_per_meter_squared and kilowatt_hour_per_meter_squared, respectively.

Example:

    [[sun]]
        ...
        aggregate_interval = 86400
        start_at_midnight = true
        [[[radiation]]]
            aggregate_type = energy_integral
            units = kilowatt_hour_per_meter_squared

@roe-dl
Copy link
Contributor Author

roe-dl commented Apr 1, 2022

Example: https://www.woellsdorf-wetter.de/graphs/?graph=month#sunshine

config:

    [[sunshine]]
        title = Sunshine Duration
        aggregate_type = sum
        aggregate_interval = 86400
        start_at_midnight = true
        [[[sunshine]]]
            type = column
            color = "#ffc83f"
            units = hour
            [[[[numberFormat]]]]
                decimals = 1

@roe-dl
Copy link
Contributor Author

roe-dl commented Apr 16, 2022

From weewx/weewx@77b00e5 I learnt that "unit" is used in singular in English, too. So I changed the word to singular.

@roe-dl roe-dl changed the title added chart option "units" for special target units added chart option "unit" for special target units Apr 16, 2022
@poblabs poblabs merged commit 98201a1 into poblabs:master May 15, 2022
@poblabs
Copy link
Owner

poblabs commented May 15, 2022

Can you also please update the charts wiki with this info?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants