Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.5 (build 3282) - 23 February 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 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
Post Reply
User avatar
mcrossley
Posts: 12641
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Highcharts Graphs

Post by mcrossley »

Today's tinkering... My initial stab at putting some Highcharts graphs together. I have just plonked them in my existing page whilst I figure out a better date range selection mechanism.

These are grabing the data via ajax and PHP generated JSON data from a MySQL database on my creaky old laptop out in the shed. So performance may not be up to much.

I also have a problem with the xAxis date stamps being ahead of the data by one day on some graphs - I have yet to figure this out!

After the date range selection mechanism, a decent 'theme' for the graphs is in order.

Edit: I know there is already a 'package' out there that pulls the data from WU, but I do not wish to use WU as a data source, and where is the fun if it is all already figured out for you!
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 »

Ah, excellent. I'll be drawing on your expertise at some point ;)
Steve
RayProudfoot
Posts: 3372
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: Highcharts Graphs

Post by RayProudfoot »

Very impressive charts Mark, well done. :clap:

One day when I get a MySQL database on my webserver this is what I'd like to display.
Cheers,
Ray, Cheshire.

Image
User avatar
KarlS
Posts: 135
Joined: Tue 30 Nov 2010 3:01 pm
Weather Station: Ecowitt GW1003 / WH32 / WH41
Operating System: Buster Lite on Pi4
Location: Bridge Lake, BC, Canada
Contact:

Re: Highcharts Graphs

Post by KarlS »

I've been using Highchart graphs on my web site for over a year now. It is a very powerful packge and free for non-commerical use. The data are stored in MySQL, queried with PHP. At the moment I only use it to display (the last) 24 hours of monthly log data, but it would be quite easy to modify the script to use dayfile data or any aggregation of monthly log data.

Check out the live graphs here.
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Highcharts Graphs

Post by gemini06720 »

I know there is already a 'package' out there that pulls the data from WU, but I do not wish to use WU as a data source, and where is the fun if it is all already figured out for you!
Mark, I do not know which package you are referring to...

But the one package I have been using on my different web sites (such as 'Weather Underground Graphics') can 'pull' data not only from Weather Underground but also from the MySQL database produced by an associated program to Weather Display (which I am not using on my development computer, so I cannot try it) or from both.

Mark, I have noticed some minor 'glitches' with the display of the degree symbol on the temperature charts.

The 'Highcharts' is quite an impressive package, a bit confusing at first but with so many possibilities...
User avatar
mcrossley
Posts: 12641
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 »

steve wrote:Ah, excellent. I'll be drawing on your expertise at some point
No problem there Steve.
gemini06720 wrote:Mark, I have noticed some minor 'glitches' with the display of the degree symbol on the temperature charts.
Yes, I'll try and sort that today - it doesn't happen on my test pages.

I'm also thinking that the xAxis date 'issue' may actually be a bug in the highcharts package - I'm running a 'dev' version not the stable release because I wanted the stepped line on the 'rainfall by year' graph - a feature that hasn't been released yet.
User avatar
mcrossley
Posts: 12641
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 »

All fixed...

Corrupt degree symbol: I had lost my minimiser 'batch file' that I used to drag-n-drop scripts to, when I recreated it I forgot to put in the option for UTF-8 encoding.

Bad xAxis dates: Looks like a bug in Highcharts handling midnight date/times (as stored in my database), the xAxis correctly decodes the Javascript time (in millisecs sincs 1970) to the date , but the data point tooltip decode seems to think it is the previous day. Adding 10 minutes to time before passing it to Highcharts seems to be a workaround for now.
User avatar
mcrossley
Posts: 12641
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 »

Hmm, playing around with a 'real time' kind of thing. This is just an ugly kludge-up but you get the idea...

http://weather.wilmslowastro.com/index2.htm now deleted.
Last edited by mcrossley on Mon 20 Oct 2014 8:29 am, edited 1 time in total.
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Highcharts Graphs

Post by nitrx »

Looks great, besides the graph restarts achter a refresh of he page
User avatar
mcrossley
Posts: 12641
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 »

nitrx wrote:the graph restarts achter a refresh of he page
Yep, you would have to work out some way of caching the last hours worth of data from realtime.txt on the web server to pre-populate the graphs...
User avatar
mcrossley
Posts: 12641
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 added caching of the last hours worth of realtime.txt data on my web server, so the 'realtime' graph is now pre-populated with some data...

http://weather.wilmslowastro.com/index2.htm Edit: now deleted
Last edited by mcrossley on Mon 20 Oct 2014 8:30 am, edited 1 time in total.
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Highcharts Graphs

Post by nitrx »

Nice, still a disadvantage the chart doens't update automatically , I see you use a diffrent realtime.txt and also php ? I cant't copy code ;)
User avatar
mcrossley
Posts: 12641
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 »

Not sure what you mean? The graph preloads the last hours data, then updates every minute from then on - shame I do not have a Davis station which much faster updates available, for the FO updates every minute are about all you get?

The PHP source is available try the parameter "view=sce"

http://weather.wilmslowastro.com/realti ... p?view=sce
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Highcharts Graphs

Post by nitrx »

mcrossley wrote:Not sure what you mean? The graph preloads the last hours data, then updates every minute from then on
I was looking at the graph for several minutes no new lines or points wre plot, when I did a refresh of the page I saw the new plotted graph, I also dont have a Davis so updates are about 48 seconds by the station.

I see you've upated the page works fine now great job !
Last edited by nitrx on Sat 24 Nov 2012 6:28 pm, edited 1 time in total.
User avatar
mcrossley
Posts: 12641
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 »

maybe I was still 'fiddling' with it - I'm leaving it now to go out for the evening so is should be stable, and updating ;)
Post Reply