If you use Cumulus, please donate Image

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Highcharts Graphs

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

Re: Highcharts Graphs

Postby mcrossley » Fri May 22, 2015 1:03 pm

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
HRVistaWeather
Posts: 161
Joined: Mon Apr 09, 2012 2:38 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 (64bit)
Location: Franklin, Huon Valley, Tasmania

Re: Highcharts Graphs

Postby HRVistaWeather » Sun Nov 15, 2015 11:57 am

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

Huon River Vista Weather - South Franklin - Tasmania
Davis Vantage Pro 2 Plus - FARS, Cumulus MX, 2 Soil Temp/Moist Solar/Rad.
Weather PC Died 2016/11/21 15:25 Cannot justify replacement (Website dead)

User avatar
mcrossley
Posts: 4968
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Postby mcrossley » Wed Dec 23, 2015 7:57 pm

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: 26199
Joined: Mon Jun 02, 2008 6:49 pm
Weather Station: None
Operating System: None
Location: On tour in France
Contact:

Re: Highcharts Graphs

Postby steve » Wed Dec 23, 2015 8:06 pm

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

GET http://weather.wilmslowastro.com/utils/historicSunshineByYear2.php 404 (Not Found)
GET http://weather.wilmslowastro.com/utils/historicRainByYear2.php 404 (Not Found)
Steve
-----
Hosting available for Cumulus web sites. See http://sandaysoft.com/forum/viewtopic.php?f=2&t=11876

Like Cumulus and want to support it? Please donate! Image

User avatar
mcrossley
Posts: 4968
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Postby mcrossley » Wed Dec 23, 2015 8:15 pm

Ahem, well you would! :oops:

Try forcing a refresh now - a slip up on the file renaming front.

User avatar
steve
Cumulus Author
Posts: 26199
Joined: Mon Jun 02, 2008 6:49 pm
Weather Station: None
Operating System: None
Location: On tour in France
Contact:

Re: Highcharts Graphs

Postby steve » Wed Dec 23, 2015 8:16 pm

Yes, working nicely now :)
Steve
-----
Hosting available for Cumulus web sites. See http://sandaysoft.com/forum/viewtopic.php?f=2&t=11876

Like Cumulus and want to support it? Please donate! Image

User avatar
mcrossley
Posts: 4968
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Postby mcrossley » Sat Jan 02, 2016 2:33 pm

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
HRVistaWeather
Posts: 161
Joined: Mon Apr 09, 2012 2:38 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 (64bit)
Location: Franklin, Huon Valley, Tasmania

Re: Highcharts Graphs

Postby HRVistaWeather » Sun Jan 03, 2016 10:08 pm

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/wxhistoricChartsAll.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

Huon River Vista Weather - South Franklin - Tasmania
Davis Vantage Pro 2 Plus - FARS, Cumulus MX, 2 Soil Temp/Moist Solar/Rad.
Weather PC Died 2016/11/21 15:25 Cannot justify replacement (Website dead)

User avatar
mcrossley
Posts: 4968
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Postby mcrossley » Sun Jan 03, 2016 11:03 pm

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
HRVistaWeather
Posts: 161
Joined: Mon Apr 09, 2012 2:38 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 (64bit)
Location: Franklin, Huon Valley, Tasmania

Re: Highcharts Graphs

Postby HRVistaWeather » Tue Jan 05, 2016 9:27 pm

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

Huon River Vista Weather - South Franklin - Tasmania
Davis Vantage Pro 2 Plus - FARS, Cumulus MX, 2 Soil Temp/Moist Solar/Rad.
Weather PC Died 2016/11/21 15:25 Cannot justify replacement (Website dead)

User avatar
mcrossley
Posts: 4968
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Postby mcrossley » Wed Jan 06, 2016 9:31 am

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

hour - int(2)
sun - decimal(5,1)
percent - decimal(3,1)

User avatar
HRVistaWeather
Posts: 161
Joined: Mon Apr 09, 2012 2:38 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 (64bit)
Location: Franklin, Huon Valley, Tasmania

Re: Highcharts Graphs

Postby HRVistaWeather » Wed Jan 06, 2016 8:34 pm

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

Huon River Vista Weather - South Franklin - Tasmania
Davis Vantage Pro 2 Plus - FARS, Cumulus MX, 2 Soil Temp/Moist Solar/Rad.
Weather PC Died 2016/11/21 15:25 Cannot justify replacement (Website dead)

User avatar
mcrossley
Posts: 4968
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Postby mcrossley » Wed Jan 06, 2016 11:15 pm

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
HRVistaWeather
Posts: 161
Joined: Mon Apr 09, 2012 2:38 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 (64bit)
Location: Franklin, Huon Valley, Tasmania

Re: Highcharts Graphs

Postby HRVistaWeather » Thu Jan 07, 2016 2:26 am

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

Huon River Vista Weather - South Franklin - Tasmania
Davis Vantage Pro 2 Plus - FARS, Cumulus MX, 2 Soil Temp/Moist Solar/Rad.
Weather PC Died 2016/11/21 15:25 Cannot justify replacement (Website dead)

User avatar
mcrossley
Posts: 4968
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Postby mcrossley » Thu Jan 07, 2016 9:13 am

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.


Return to “3rd Party Tools”

Who is online

Users browsing this forum: No registered users and 3 guests