mtatsuma / MMM-WeatherChart

Magic Mirror Module for displaying weather chart
MIT License
26 stars 8 forks source link

Option to show UV index in hourly chart #51

Open thariq-shanavas opened 1 year ago

thariq-shanavas commented 1 year ago

Setting showUV = true in the configuration displays the 12-hour UV Index forecast. Only works for hourly weather.

thariq-shanavas commented 1 year ago
image
mtatsuma commented 1 year ago

@thariq-shanavas Thank you for your PR!

y2 axis is used for the UV index data. But the y2 axis is also used for rain and snow data. UV index and rain have different range of data and these data should not share the same axis.

I want to consider how to display the UV index data well on the graph. Please give me some time.

When many lines are displayed on the graph at the same time, it becomes difficult to understand what represents what. What about displaying the UX index as several categories, such as Low, Moderate, High, instead of a number? https://en.wikipedia.org/wiki/Ultraviolet_index

thariq-shanavas commented 1 year ago

Hello @mtatsuma

I tried using a separate y-axis for the UV, but it squashed the temperature and precipitation axes too much. It doesn't rain very much where I live, so sharing an axis between rain and UV was an acceptable compromise for me. If I may suggest an alternative, color-coding the UV level could be a great option. See attached example.

248862022-d29e7fee-5213-4332-a246-096b7eff05cf

Unfortunately, I am not familiar enough with javascript or chart.js to implement this.

On a side note, I made a fork of the now deprecated MMM-uv-index to show the current UV index using the supported One Call 3.0 API. It does not, however, show the forecast for UV Index which I was hoping to accomplish with this PR.