Page 22 of 28

Re: Highcharts Graphs

Posted: Wed 01 Feb 2017 5:40 pm
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. ;)

Re: Highcharts Graphs

Posted: Wed 01 Feb 2017 6:24 pm
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.

Re: Highcharts Graphs

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

Re: Highcharts Graphs

Posted: Wed 01 Feb 2017 7:41 pm
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!)

Re: Highcharts Graphs

Posted: Tue 14 Mar 2017 5:36 am
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

Re: Highcharts Graphs

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

Re: Highcharts Graphs

Posted: Tue 14 Mar 2017 8:21 pm
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.

Re: Highcharts Graphs

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

Re: Highcharts Graphs

Posted: Sun 14 May 2017 2:27 pm
by vpokroglo
What is regional average plot on Historic monthly average temperature graph?

Re: Highcharts Graphs

Posted: Sun 14 May 2017 5:25 pm
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.

Re: Highcharts Graphs

Posted: Sun 13 Aug 2017 3:59 am
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

Re: Highcharts Graphs

Posted: Sun 13 Aug 2017 1:58 pm
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
        }

Re: Highcharts Graphs

Posted: Sun 13 Aug 2017 3:00 pm
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
        }

Re: Highcharts Graphs

Posted: Sun 13 Aug 2017 5:02 pm
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.

Re: Highcharts Graphs

Posted: Sun 13 Aug 2017 6:44 pm
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