IMPORTANT! The server may go down soon - possibly permanently. Please read the latest post in Announcements and News

FTP is broken. I advise all users using my server for their web site to make alternative arrangements.

Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

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: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Postby mcrossley » Mon Nov 26, 2012 2:16 pm

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: 1289
Joined: Sun Dec 13, 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Highcharts Graphs

Postby nitrx » Mon Nov 26, 2012 2:29 pm

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: 1289
Joined: Sun Dec 13, 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Highcharts Graphs

Postby nitrx » Mon Nov 26, 2012 3:13 pm

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: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Postby mcrossley » Mon Nov 26, 2012 3:40 pm

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: 1289
Joined: Sun Dec 13, 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Highcharts Graphs

Postby nitrx » Mon Nov 26, 2012 4:02 pm

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: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Postby mcrossley » Mon Nov 26, 2012 11:19 pm

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: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Postby mcrossley » Tue Nov 27, 2012 10:19 am

...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: 1465
Joined: Sat Aug 13, 2011 9:33 am
Weather Station: WH1081
Operating System: Windows 7 64bit HP SP1
Location: Somewhere in the USA
Contact:

Re: Highcharts Graphs

Postby water01 » Tue Nov 27, 2012 11:55 am

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?

KevinF
Posts: 71
Joined: Sat Apr 14, 2012 5:01 pm
Weather Station: WMR200
Operating System: XP SP3
Location: Lancashire

Re: Highcharts Graphs

Postby KevinF » Tue Nov 27, 2012 2:06 pm

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: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Postby mcrossley » Tue Nov 27, 2012 2:22 pm

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: 1465
Joined: Sat Aug 13, 2011 9:33 am
Weather Station: WH1081
Operating System: Windows 7 64bit HP SP1
Location: Somewhere in the USA
Contact:

Re: Highcharts Graphs

Postby water01 » Tue Nov 27, 2012 8:23 pm

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?

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

Re: Highcharts Graphs

Postby mcrossley » Tue Nov 27, 2012 8:29 pm

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: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts Graphs

Postby mcrossley » Thu Nov 29, 2012 10:43 am

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: 1465
Joined: Sat Aug 13, 2011 9:33 am
Weather Station: WH1081
Operating System: Windows 7 64bit HP SP1
Location: Somewhere in the USA
Contact:

Re: Highcharts Graphs

Postby water01 » Thu Nov 29, 2012 1:35 pm

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?

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

Re: Highcharts Graphs

Postby mcrossley » Thu Nov 29, 2012 1:47 pm

Done.


Return to “3rd Party Tools”

Who is online

Users browsing this forum: No registered users and 2 guests