Welcome to the Cumulus Support forum.

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

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.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

Highcharts Graphs

Discussion and support for 3rd-party (non-Sandaysoft) tools for Cumulus
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Post by mcrossley »

I had hoped that al the information was in the thread - somewhere, it has evolved somewhat from the start - which bits are you missing?
User avatar
BeaumarisWX
Posts: 357
Joined: Mon 09 Apr 2012 2:38 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 Pro Hades Canyon
Location: Beaumaris, Tasmania, AU
Contact:

Re: Highcharts Graphs

Post by BeaumarisWX »

Hi Mark,

1: Added Australian UV Colour Bands.
2: Displays Variation in UV and Solar Rad (Last 4 Days not Extreme nor Unusual for Franklin) but highlights our variability well.

Thanks again for your underlying core concept.

Regards,

Tony
You do not have the required permissions to view the files attached to this post.
Tony Beaumaris, Tasmania (AUS)

CMX Mobile : https://beaumaris-weather.com/BWX/
CMX Default: https://beaumaris-weather.com/cumulusmx_default/
Colour Dashboard : https://beaumaris-weather.com/dashborad_color.php
Click below for Saratoga Template :
Image
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Post by mcrossley »

I was playing around some more with Highcharts, I added some 'drill down' ability to couple of my historic graphs. The implementation code is pretty horrible, but as a concept it works. http://weather.wilmslowastro.com/graphs_historic.php
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Highcharts Graphs

Post by steve »

I get 404s when I click on either of the 'drill down' buttons:

GET http://weather.wilmslowastro.com/utils/ ... yYear2.php 404 (Not Found)
GET http://weather.wilmslowastro.com/utils/ ... yYear2.php 404 (Not Found)
Steve
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Post by mcrossley »

Ahem, well you would! :oops:

Try forcing a refresh now - a slip up on the file renaming front.
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Highcharts Graphs

Post by steve »

Yes, working nicely now :)
Steve
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Post by mcrossley »

I have played around some more, I have converted the daily graphs to use scrollable StockCharts rather than have fixed time ranges, and added a couple of new graphs. The 'comfort zone' chart is a bit of a kludge, but I found MySQL was a bit slow doing all the work in query, so there is some post processing in PHP. Now I just need another 15 years data to smooth the curves out!

http://weather.wilmslowastro.com/graphs_historic.php

Edit: I forgot to say, that the comfort zone chart was inspired by the WeatherSpark presentation.
User avatar
BeaumarisWX
Posts: 357
Joined: Mon 09 Apr 2012 2:38 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 Pro Hades Canyon
Location: Beaumaris, Tasmania, AU
Contact:

Re: Highcharts Graphs

Post by BeaumarisWX »

Hi Mark,

Brilliant new features (Love them).

I hope it's ok as usual to use the scripts. Interesting (and obvious) the reverse display on Comfort Graph between yours and mine :D

I am unable to sort out the "sunbyhour" graph, is this an additional table you upload to or is it a mysql view ?

New: http://hrvistaweather.com/weather/wxhis ... rtsAll.php
Old: http://hrvistaweather.com/weather/wxhistoricCharts.php

Kind Regards,
You do not have the required permissions to view the files attached to this post.
Tony Beaumaris, Tasmania (AUS)

CMX Mobile : https://beaumaris-weather.com/BWX/
CMX Default: https://beaumaris-weather.com/cumulusmx_default/
Colour Dashboard : https://beaumaris-weather.com/dashborad_color.php
Click below for Saratoga Template :
Image
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Post by mcrossley »

Hi Tony, yes feel free to use the scripts, I wouldn't put the src view function in if I wanted to keep them secret.

The sun by hour query is quite expensive and the data doesn't change very dynamically, so I run it once a day and save the result in a separate table. I have a post insert trigger on my daydata table (because that only gets updated at rollover) that removes the existing data and repopulates it from the full logtable.

Edit: My post insert trigger looks like this (you will need to do some editing to match your dates, and convert to a suitable 'standard' timezone without DST)...

Code: Select all

BEGIN
    DELETE FROM `sunbyhour`;
    INSERT INTO `sunbyhour`
			SELECT  hour,
					sum(sun),
					round(sum(sun) / count(*) * 100, 1)
			FROM (
				SELECT  hour(CONVERT_TZ(t.LogDateTime,"EUROPE/London","UTC")) AS hour,
						(min(n.HrsSunShine) - min(t.HrsSunShine)) AS sun
				FROM `fulldata` as t
				JOIN `fulldata` as n
				ON t.LogDateTime = date_sub(n.LogDateTime, INTERVAL 1 hour)
				WHERE t.LogDateTime > "2013-4-14"
				AND hour(t.LogDateTime) BETWEEN 2 AND 22
				GROUP BY date_format(t.LogDateTime, "%Y%m%d%H")
			) as x
			GROUP BY hour;
END
I should probably do something similar with the temperature by hour, and comfort data. They are both quite expensive queries too.

Edit: Actually, looking at that sun query now with hindsight, I'm sure it is actually a lot simpler to do than that....
User avatar
BeaumarisWX
Posts: 357
Joined: Mon 09 Apr 2012 2:38 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 Pro Hades Canyon
Location: Beaumaris, Tasmania, AU
Contact:

Re: Highcharts Graphs

Post by BeaumarisWX »

Hi Mark,

Thanks for this, though I must be missing a field when I created the sunbyhour table.

I tried adding LogDateTime field as well (though did not think it was required) and it ran but only returned one row with zero datetime.

I obviously have the table structure incorrect, ensured I have correct start time for Solar and used Australia/Brisbane (non DST) vs my Australia/Hobart which is DST (Both +10 ST)

regards,
You do not have the required permissions to view the files attached to this post.
Tony Beaumaris, Tasmania (AUS)

CMX Mobile : https://beaumaris-weather.com/BWX/
CMX Default: https://beaumaris-weather.com/cumulusmx_default/
Colour Dashboard : https://beaumaris-weather.com/dashborad_color.php
Click below for Saratoga Template :
Image
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Post by mcrossley »

Tony, I have three columns - one redundant (sun), but still populated...

hour - int(2)
sun - decimal(5,1)
percent - decimal(3,1)
User avatar
BeaumarisWX
Posts: 357
Joined: Mon 09 Apr 2012 2:38 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 Pro Hades Canyon
Location: Beaumaris, Tasmania, AU
Contact:

Re: Highcharts Graphs

Post by BeaumarisWX »

Thanks Mark,
Ah that was the 3rd column could not figure that one out from the statement.
I am afraid it just does not want to play the game: returns only one row ?

hour 0
sun 3153.9
percent 28.1
Tony Beaumaris, Tasmania (AUS)

CMX Mobile : https://beaumaris-weather.com/BWX/
CMX Default: https://beaumaris-weather.com/cumulusmx_default/
Colour Dashboard : https://beaumaris-weather.com/dashborad_color.php
Click below for Saratoga Template :
Image
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Post by mcrossley »

I think your problem is in the TZ conversion, you are converting to UTC. What you need to do is convert from your DST based TZ to your local TZ without DST, so (if I have the TZ correct) something like...

Code: Select all

hour(CONVERT_TZ(t.LogDateTime,"Australia/Hobart","+10:00")) AS hour,
User avatar
BeaumarisWX
Posts: 357
Joined: Mon 09 Apr 2012 2:38 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 Pro Hades Canyon
Location: Beaumaris, Tasmania, AU
Contact:

Re: Highcharts Graphs

Post by BeaumarisWX »

Hi Mark,

Appreciated, yes your proposal looks correct to me (including zones/+10) etc.

Tried everything, but still no joy trying to convert, though as it's DST that's trying to be adjusted I decided not to bother and just use the time recorded, which worked. I changed the description for now from (UTC) to (AET) which is stating it's either or (AEST) or (AEDT) until I find a way to make it work. The chart even looks correct with how things are here always early morn sun backs of late morn then increases again around 16:00.

Only thing that I can't fix is the missing 1hr and 23hr on the chart, they just won't display, tried changing the sql script fro 2 to 22 (to) 1 to 23 but that screwed it big time. php .js is correct starts at 00 and ends 23, no idea.

Thanks anyway Mark I now understand the process, so will play over time. Let you know if I figure it out).

Actually what I think might be an option is to set it up as a view, that way no need to run a script to refresh it. Might look at that.
You do not have the required permissions to view the files attached to this post.
Tony Beaumaris, Tasmania (AUS)

CMX Mobile : https://beaumaris-weather.com/BWX/
CMX Default: https://beaumaris-weather.com/cumulusmx_default/
Colour Dashboard : https://beaumaris-weather.com/dashborad_color.php
Click below for Saratoga Template :
Image
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Post by mcrossley »

Hi Tiny, that is looking good - sadly with a bit higher figures than me :(

I deliberately excluded the 00 23 hours because the sunshine hours is a cumulative number for the day, so resets to zero at midnight. Coping with that wrap around would be beyond my small brain to achieve in a SQL query.
Post Reply