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: 12686
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 »

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: 60
Joined: Fri 01 Jun 2012 4:58 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 11 Home
Location: New Forest. UK
Contact:

Re: Highcharts Graphs

Post by Bridger »

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: 12686
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 »

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: 60
Joined: Fri 01 Jun 2012 4:58 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 11 Home
Location: New Forest. UK
Contact:

Re: Highcharts Graphs

Post by Bridger »

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: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: Highcharts Graphs

Post by Phil23 »

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
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
User avatar
mcrossley
Posts: 12686
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 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: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: Highcharts Graphs

Post by Phil23 »

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.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
User avatar
mcrossley
Posts: 12686
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 »

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: 101
Joined: Thu 24 Feb 2011 7:45 pm
Weather Station: WS-2350
Operating System: Raspberry Pi 2
Location: Slovenija
Contact:

Re: Highcharts Graphs

Post by vpokroglo »

What is regional average plot on Historic monthly average temperature graph?
Image
User avatar
mcrossley
Posts: 12686
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 »

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: 225
Joined: Sat 27 Aug 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Wickliffe, Ohio
Contact:

Re: Highcharts Graphs

Post by jlmr731 »

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
Mapantz
Posts: 1774
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Highcharts Graphs

Post by Mapantz »

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
jlmr731
Posts: 225
Joined: Sat 27 Aug 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Wickliffe, Ohio
Contact:

Re: Highcharts Graphs

Post by jlmr731 »

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
        }
Mapantz
Posts: 1774
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Highcharts Graphs

Post by Mapantz »

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
jlmr731
Posts: 225
Joined: Sat 27 Aug 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Wickliffe, Ohio
Contact:

Re: Highcharts Graphs

Post by jlmr731 »

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
Post Reply