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 » Wed Feb 01, 2017 5:40 pm

Bridger wrote:My dayfile SQL table appears to be fully populated up to 30 Jan and this would appear to be born out by my original Historic Graphs which all show daily data up to 30 Jan, using the same table.

But the old graphs only drag back data from 2 years ago - 01 Feb 2015 at the mo. The new graphs go back to 5 Sept 2012
Bridger wrote:Edit: I checked the graphs this morning and the end date on the DailyTemperature graph is now 28 Jan (was 27 Jan yesterday) however, the data on the last plot is for 31 Jan. I have double checked this in the database and yesterday.ini. Min Temp=7.3, MaxTemp=11.2 Avg Temp=9.5.

Which re-enforces my opinion that you have some missing data. ;)

Bridger
Posts: 32
Joined: Fri Jun 01, 2012 4:58 pm
Weather Station: Davis Vantage Vue
Operating System: Windows XP Pro
Location: New Forest. UK
Contact:

Re: Highcharts Graphs

Postby Bridger » Wed Feb 01, 2017 6:24 pm

Which re-enforces my opinion that you have some missing data. ;)

You are so right! After spending a wet afternoon trawling through my SQL table and monthly log files I have discovered 3 missing days from July 2014 which I hadn't noticed before.:oops: :oops:
I'm not quite sure what to do about it yet but thanks for your help.

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 Feb 01, 2017 6:40 pm

Bridger wrote:
Which re-enforces my opinion that you have some missing data. ;)

You are so right! After spending a wet afternoon trawling through my SQL table and monthly log files I have discovered 3 missing days from July 2014 which I hadn't noticed before.:oops: :oops:
I'm not quite sure what to do about it yet but thanks for your help.


Three options as I see it

1. copy data from the previous or next day
2. copy the data from a nearby station
3. rewrite the scripts so that they pass all the data as date/data pairs so that they plot correctly

Bridger
Posts: 32
Joined: Fri Jun 01, 2012 4:58 pm
Weather Station: Davis Vantage Vue
Operating System: Windows XP Pro
Location: New Forest. UK
Contact:

Re: Highcharts Graphs

Postby Bridger » Wed Feb 01, 2017 7:41 pm

mcrossley wrote:Three options as I see it

1. copy data from the previous or next day
2. copy the data from a nearby station
3. rewrite the scripts so that they pass all the data as date/data pairs so that they plot correctly

I may go for a combination of options 1 and 2, using data from my local METAR station at Hurn. (Option 3 sounds way beyond my knowledge level!)

Phil23
Posts: 111
Joined: Sat Jul 16, 2016 11:59 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Win7 Pro
Location: Australia

Re: Highcharts Graphs

Postby Phil23 » Tue Mar 14, 2017 5:36 am

Hi Mark,

Just browsed this entire thread & can't see an answer to my question.

I'm using just the standard files, trends.htm & cumuluscharts.js.

Is it possible some how to use an extended URL that can open a particular chart other than the default Temperature one.

Steve mentions using "window.location.href", in the post I put in the wrong thread, but the usage is a bit out of my present depth.

Thanks

Phil

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 » Tue Mar 14, 2017 9:04 am

Hi Phil, yes it should be pretty straightforward to do that.

The the script modify the changeImage() and $(document).ready() functions as follows (untested!)...

Code: Select all

function changeImage(im) {
   switch (im) {
   case 'temp':
      temperature();
      break;
   case 'press':
      pressure();
      break;
   case 'wind':
      wind();
      break;
   case 'windDir':
      windDir();
      break;
   case 'rain':
      rain();
      break;
   case 'humidity':
      humidity();
      break;
   case 'solar':
      solar();
      break;
   default:
      temperature();
   }
}

$(document).ready(function () {
   changeImage(window.location.href.split('?')[1]);
});


Then call the page as http: //...../<page_name>.htm?temp

or substitute "temp" with any of the keywords in the 'switch' statement.

If it works OK that could be a useful change to the base code.

Phil23
Posts: 111
Joined: Sat Jul 16, 2016 11:59 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Win7 Pro
Location: Australia

Re: Highcharts Graphs

Postby Phil23 » Tue Mar 14, 2017 8:21 pm

Hi Mark,

Happy to test it but a bit short on java knowledge.

I already have this code,

Code: Select all

$(document).ready(function () {   
    $.ajax({url: "graphconfig.json", dataType:"json", success: function (result) {
            config=result;
         doTemp();
           
        }});
});


do I completely replace it's content with

Code: Select all

$(document).ready(function () {
   changeImage(window.location.href.split('?')[1]);
});


or add that extra line in?

Also I currently have,

Code: Select all

function changeGraph(graph) {
   switch (graph) {
      case 'temp':
         doTemp();
            break;
      case 'dailytemp':
            doDailyTemp();
            break;
        case 'press':
            doPress();
            break;


Presume the new function is added above this?

Also does default behaviour stay the same on the page, with the exception of the full url being displayed?

Sorry by my Java understanding is a little thin.

Thanks

Phil.

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 » Tue Mar 14, 2017 9:42 pm

Ah, my error, you have a different version of the page from me, you have the Cumulus MX version. Let me take a look and provide some revised code, probably tomorrow now...

User avatar
vpokroglo
Posts: 51
Joined: Thu Feb 24, 2011 7:45 pm
Weather Station: WS-2350
Operating System: Raspberry Pi 2
Location: Slovenija

Re: Highcharts Graphs

Postby vpokroglo » Sun May 14, 2017 2:27 pm

What is regional average plot on Historic monthly average temperature graph?
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 » Sun May 14, 2017 5:25 pm

You input the average temperatures for your area as recorded by your local met. office. These will probably be quite different from the averages recorded by your station.

jlmr731
Posts: 110
Joined: Sat Aug 27, 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Youngstown, Ohio
Contact:

Re: Highcharts Graphs

Postby jlmr731 » Sun Aug 13, 2017 3:59 am

Been working on some customization to the stock MX highcharts graphs.
I now can call to a mysql query then convert to json for the chart and it all works well ( just a lot of reading to get it to work)
Here is where I am stuck : I want the chart to open up at and a certain range say like 3 month's, 1 year or whatever I have added in

Code: Select all

    rangeSelector: {
        selected: 0
    }

to just about every where within the function part of said chart depending on where i add i get either no render of the chart or it renders at the default full chart.
Ive even tried just selected: 0 within the range part already in the script and no matter where i use it within this part i get nothing

Code: Select all

rangeSelector: {
            buttons: [{
                    count: 6,
                    type: 'hour',
                    text: '6h'
                }, {
                    count: 12,
                    type: 'hour',
                    text: '12h'
                }, {
                    type: 'all',
                    text: 'All'
                }],
            inputEnabled: false
        }

Dont know if its something Ive overlooked or just using the wrong code for it.

Thanks,
Jeff

User avatar
Mapantz
Posts: 440
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Highcharts Graphs

Postby Mapantz » Sun Aug 13, 2017 1:58 pm

I think you'll have to add another range in to it, as well as the item to have selected by default, something like..


Code: Select all

rangeSelector: {
        selected: 2,
            buttons: [{
                    count: 6,
                    type: 'hour',
                    text: '6h'
                }, {
                    count: 12,
                    type: 'hour',
                    text: '12h'
                }, {
                    count: 3,
                    type: 'month',
                    text: '3m'
                }, {
                    type: 'all',
                    text: 'All'
                }],
            inputEnabled: false
        }
Image
Image

jlmr731
Posts: 110
Joined: Sat Aug 27, 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Youngstown, Ohio
Contact:

Re: Highcharts Graphs

Postby jlmr731 » Sun Aug 13, 2017 3:00 pm

When entered like that i do get the desired selected range but then all buttons are gone.
One would think it should be there then to go on to read the button layout.

Mapantz wrote:I think you'll have to add another range in to it, as well as the item to have selected by default, something like..


Code: Select all

rangeSelector: {
        selected: 2,
            buttons: [{
                    count: 6,
                    type: 'hour',
                    text: '6h'
                }, {
                    count: 12,
                    type: 'hour',
                    text: '12h'
                }, {
                    count: 3,
                    type: 'month',
                    text: '3m'
                }, {
                    type: 'all',
                    text: 'All'
                }],
            inputEnabled: false
        }

User avatar
Mapantz
Posts: 440
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Highcharts Graphs

Postby Mapantz » Sun Aug 13, 2017 5:02 pm

jlmr731 wrote:When entered like that i do get the desired selected range but then all buttons are gone.
One would think it should be there then to go on to read the button layout.


Could you upload or link me to your .js for me, i'll have a look.
Image
Image

jlmr731
Posts: 110
Joined: Sat Aug 27, 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Youngstown, Ohio
Contact:

Re: Highcharts Graphs

Postby jlmr731 » Sun Aug 13, 2017 6:44 pm

Mapantz wrote:
Could you upload or link me to your .js for me, i'll have a look.



here is the script, as you can see its pretty much the default cumulusmx script only change i made was to add in a few more buttons on the temp graph and to a php file to get data from mysql

http://www.youngstownweather.com/js/mycumuluscharts.js


Return to “3rd Party Tools”

Who is online

Users browsing this forum: No registered users and 4 guests