Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Annual Data Summary - Highlighting High Values

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
captzero
Posts: 363
Joined: Wed 03 Mar 2010 10:20 am
Weather Station: Vantage Pro2 w/ daytime FARS
Operating System: Windows 10
Location: Brisbane, Australia
Contact:

Annual Data Summary - Highlighting High Values

Post by captzero »

Hi Guys. Probably one for David...

I'm using the Annual Data Summary (js version) and it highlights zero values for rain and rainrate.

I'd like to highlight 'high' values for temperature (+37C) and wind (+50kph) with a view to eventually using a colour scale for temps.

I've created the following in the datasummary.css to create a colour for high value
#table_container .highvalue { color: #CC0000;}

I tried adding the following line in the dayfile.js

if((parseFloat(wd_data[dayfilecol])>37)&&(dayfilecol==6)){$(data_cell).addClass('highvalue');}}

but this disables or crashes the script.

Am I on the right track? Any help is appreciated. Thanks in advance.
Dan

http://www.brisbaneliveweather.com




A man with a thermometer always knows the temperature. A man with two thermometers, not so sure.
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Annual Data Summary - Highlighting High Values

Post by daj »

Just a quick observation as I have not had time to test it, but if this is a copy and paste of the code you use you have a rouge } at the end of the line, unless it is part of a fuller set of code
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
captzero
Posts: 363
Joined: Wed 03 Mar 2010 10:20 am
Weather Station: Vantage Pro2 w/ daytime FARS
Operating System: Windows 10
Location: Brisbane, Australia
Contact:

Re: Annual Data Summary - Highlighting High Values

Post by captzero »

captzero wrote:you have a rouge }
Yes, I pasted too much code in. It should read
if((parseFloat(wd_data[dayfilecol])>37)&&(dayfilecol==6)){$(data_cell).addClass('highvalue');
Dan

http://www.brisbaneliveweather.com




A man with a thermometer always knows the temperature. A man with two thermometers, not so sure.
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Annual Data Summary - Highlighting High Values

Post by daj »

Ok, let me have a look in more detail.

I also see you are using the compressed version of the JS, which is harder to read and customize.

Here's a easier version to read if you wanted to use it

http://grantownweather.co.uk/historic/r ... ile-max.js

I'll pop your code into my setup and see if I can help you
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Annual Data Summary - Highlighting High Values

Post by daj »

Dan

I added your code and it worked fine for me -- I had to change the 37 down to 20 for me as I've never had a reading of 37 :-)

I added your line below line 133 of the non-compressed JS

(so I am showing line 133, 134 (new one) and line 135)

Code: Select all

if ((parseFloat(wd_data[dayfilecol].split(',').join('.')) == 0) && (dayfilecol ==14 || dayfilecol ==1)) { $(data_cell).addClass('zerovalue'); }
if((parseFloat(wd_data[dayfilecol])>20)&&(dayfilecol==6)){$(data_cell).addClass('highvalue');}
}
Here it is live on my site

http://grantownweather.co.uk/historic/dataSummary.php
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
captzero
Posts: 363
Joined: Wed 03 Mar 2010 10:20 am
Weather Station: Vantage Pro2 w/ daytime FARS
Operating System: Windows 10
Location: Brisbane, Australia
Contact:

Re: Annual Data Summary - Highlighting High Values

Post by captzero »

Thanks David,
daj wrote: had to change the 37 down to 20 for me as I've never had a reading of 37
:lol: I forgot, not everyone lives in Gods country.

Thats good news.

I'll give it a try with the new javascript and report back. Unfortunatly I wont be able to do much right now as I am about to leave for the night.
Dan

http://www.brisbaneliveweather.com




A man with a thermometer always knows the temperature. A man with two thermometers, not so sure.
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Annual Data Summary - Highlighting High Values

Post by daj »

captzero wrote:I'll give it a try with the new javascript....
Just to be clear, it is the same javascript just formatted for better reading!
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Annual Data Summary - Highlighting High Values

Post by daj »

captzero wrote:Thanks David,
daj wrote: had to change the 37 down to 20 for me as I've never had a reading of 37
:lol: I forgot, not everyone lives in Gods country.
You might need to lower your threshold too -- I could not see a temperature of over 37 on your site :shock:
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
captzero
Posts: 363
Joined: Wed 03 Mar 2010 10:20 am
Weather Station: Vantage Pro2 w/ daytime FARS
Operating System: Windows 10
Location: Brisbane, Australia
Contact:

Re: Annual Data Summary - Highlighting High Values

Post by captzero »

daj wrote:I could not see a temperature of over 37 on your site
Yes, true. With the recent La Niña and all the wet weather and floods we copped over the summer here, its been an unusually mild summer. I'm planning ahead.
Doh...That also may explain why I wasnt able to see the changes. :bash: Something to look at when I get home this afternoon.
Dan

http://www.brisbaneliveweather.com




A man with a thermometer always knows the temperature. A man with two thermometers, not so sure.
captzero
Posts: 363
Joined: Wed 03 Mar 2010 10:20 am
Weather Station: Vantage Pro2 w/ daytime FARS
Operating System: Windows 10
Location: Brisbane, Australia
Contact:

Re: Annual Data Summary - Highlighting High Values

Post by captzero »

David,

Thanks for your help with this. I was able to add different colours for a corresponding temperature range / wind / pressure etc. Results here:
http://www.brisbaneliveweather.com/annual.php
Dan

http://www.brisbaneliveweather.com




A man with a thermometer always knows the temperature. A man with two thermometers, not so sure.
Post Reply