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 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
User avatar
mcrossley
Posts: 12689
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 »

Did you keep a copy of sleep.exe from the RK? I suggest you put the sleep.exe and tail.exe either in the same folder as the batch file, or in the Windows folder (then they will be available to any batch file you write).
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:Did you keep a copy of sleep.exe from the RK? I suggest you put the sleep.exe and tail.exe either in the same folder as the batch file, or in the Windows folder (then they will be available to any batch file you write).
There is no sleep.exe in the zip what do you mean with RK ? Yo mean I've to download the win 2003 resource kit ? Is the lates not a self installing product..

Aha done works now used sleep form resource kit and tail from unixthings :D will setup now the other things
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 »

Great job Mark ,

Data are displayed one hour behind for me but the graphs are almost working fine now :clap: http://www.apeldoorn.tk/weer/realtimecumulus.htm waiying a minute or more te graph behaves strange ...
User avatar
mcrossley
Posts: 12689
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 »

That is bad! Your data shows one hour ahead of me, which is what I would expect. I cannot see how it is an hour behind for you as the time is just passed as a string.

I have updated the script again, I have changed the getRealtime() function to use JQuery AJAX so I can invoke its cach busting abilities (not available on the normal JQuery 'get()' as I think I was picking up an out of date realtime file from your site.

Code: Select all

		getRealtime = function () {
			$.ajax({
				url: './realtime.txt',
				datatype: 'text',
				success: function (data) { parseRealtime(data); },
				cache: false
			});
		},
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:That is bad! Your data shows one hour ahead of me, which is what I would expect. I cannot see how it is an hour behind for you as the time is just passed as a string.

I have updated the script again, I have changed the getRealtime() function to use JQuery AJAX so I can invoke its cach busting abilities (not available on the normal JQuery 'get()' as I think I was picking up an out of date realtime file from your site.

Code: Select all

		getRealtime = function () {
			$.ajax({
				url: './realtime.txt',
				datatype: 'text',
				success: function (data) { parseRealtime(data); },
				cache: false
			});
		},
Mark I really don't know how this can happen it's 16:57 over here but the graph displays 15:57 , so the view from the UK is right, can I add some time disclaimer , I don't think so because somebody from Asia or the US will see complete other times.

Anyway the script update did solve the weird graphs thank you :!:
User avatar
mcrossley
Posts: 12689
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 »

It looks like Highcharts always uses UTC for the time stamps on the xAxis :(

So I have changed it all to avoid date constructs altogether, just pass the time as a string. It means that we lose the nice time interval plotting on a the xAxis, but avoid the nightmare TZ's were turning into!
User avatar
mcrossley
Posts: 12689
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 thought about this after I went to bed (sad!), I realised that I had been over complicating it all along. All you have to do is parse the station date/time on the server as a UTC date, then Highcharts will go on to display it as UTC - so the same date/time pops out on the chart as was generated by the station. Simples :bash: Then do the same on the client side for the realtime.txt dynamic updates.
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Highcharts Graphs

Post by water01 »

I always solve my programming problems in bed when asleep, must have a background processor running. Always have a pad and pencil next to bed, write it down and go back to sleep, so I must be as sad as you!!

By the way are there any instructions on how to set this up as I would love to have these graphs on my site. Assume the first problem is to get a MySQL database built?
David
Image
KevinF
Posts: 71
Joined: Sat 14 Apr 2012 5:01 pm
Weather Station: WMR200
Operating System: XP SP3
Location: Lancashire

Re: Highcharts Graphs

Post by KevinF »

By the way are there any instructions on how to set this up as I would love to have these graphs on my site. Assume the first problem is to get a MySQL database built?
Like David has said Mark, these graphs are very pleasing and professional looking for our websites and the viewers. In my case, I'm basic when it comes to computer language, but I am so impressed that I feel the need to dabble in MySQL to achieve what is shown on here.

So any little pointers would really be appreciated. Of course thanks for showing and sharing it.

Kind Regards Kevin
User avatar
mcrossley
Posts: 12689
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 Kevin, the 'realtime' chart doesn't need any SQL of course, it just uses the realtime.txt file you probably already have.

For the the historic charts, I am storing the Cumulus dayfile in an MySQL database (it makes the aggregated queries and time range selections so much easier than using a flat text file).

I use CumulusToolbox to copy the dayfile to the web server, and then an PHP command to import the latest data into a table. This script was written David Jamieson some time ago. You can find it in the wiki here: http://wiki.sandaysoft.com/a/ImportCumulusFile.

I do not bother with the full logfile (with 10 minute logging in my case), the daily summaries are fine for my needs.
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Highcharts Graphs

Post by water01 »

Mark, OK I get that, but I assume there is a requirement for some jquery files and some Highchart files to get the graphs displayed. Or do I just grab them and the html code from your pages?

And I have also assumed that the realtime and the historic graphs are both separate html pages?
David
Image
User avatar
mcrossley
Posts: 12689
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 put the realtime graph on my default index page (which was ajax enabled anyway) I suggest you use the 'template page' referred to above though, the code is much cleaner!

The historic graphs are on my 'historic' link, the only bit you cannot get for those is the PHP code, if you really want it I can make it available by putting a view=sce option in those too.
User avatar
mcrossley
Posts: 12689
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 a zip of the realtime Highcharts to the Wiki and a small page about it here - http://wiki.sandaysoft.com/a/Realtime_Highcharts
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Highcharts Graphs

Post by water01 »

The historic graphs are on my 'historic' link, the only bit you cannot get for those is the PHP code, if you really want it I can make it available by putting a view=sce option in those too.
Could I be a pain and use your code pretty please?
David
Image
User avatar
mcrossley
Posts: 12689
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 »

Done.
Post Reply