Page 1 of 2

Adding Heat Index To Graphs

Posted: Sun 29 Nov 2015 8:11 pm
by Grimers
Hi,

I have tried adding Heat Index to the graphs using cumuluscharts.js but to no avail.

I have made the following changes to the relevant code:

Code: Select all

series: [{
                name: 'Temperature',
                zIndex: 99,
				color: 'red'
            }, {
                name: 'Dew Point',
				color: 'green'
            }, {
                name: 'Apparent Temperature',
				color: 'yellow'
            }, {
                name: 'Wind Chill',
				color: 'blue'
            },{
				name: 'Heat Index',
				color: 'brown'
				}],

Code: Select all

$.ajax({
        url: 'tempdata.json',
        cache: false,
        dataType: 'json',
        success: function (resp) {
            chart.hideLoading();
            chart.series[0].setData(resp.temp);
            chart.series[1].setData(resp.dew);
            chart.series[2].setData(resp.apptemp);
            chart.series[3].setData(resp.wchill);
            chart.series[4].setData(resp.heatindex);
        }
    });

Re: Adding Heat Index To Graphs

Posted: Mon 30 Nov 2015 8:39 am
by steve
You can't just randomly invent things to add to the charts (or any other part of the user interface) and assume that they will magically somehow work. Cumulus doesn't provide heat index data in the chart data. Maybe it will at some point.

Re: Adding Heat Index To Graphs

Posted: Mon 30 Nov 2015 9:26 am
by Grimers
steve wrote:You can't just randomly invent things to add to the charts (or any other part of the user interface) and assume that they will magically somehow work. Cumulus doesn't provide heat index data in the chart data. Maybe it will at some point.
I don't think that, I was just curious as to why the data wouldn't pull through but thanks for confirming. :)

Re: Adding Heat Index To Graphs

Posted: Mon 30 Nov 2015 9:43 am
by mcrossley
You need to look at the data Cumulus is providing before trying to use it. As Steve says, just adding code to use data doesn't magically make Cumulus supply it.

Re: Adding Heat Index To Graphs

Posted: Mon 30 Nov 2015 5:31 pm
by Grimers
mcrossley wrote:You need to look at the data Cumulus is providing before trying to use it. As Steve says, just adding code to use data doesn't magically make Cumulus supply it.
Thanks for confirming, Mark. :)

Re: Adding Heat Index To Graphs

Posted: Mon 30 Nov 2015 11:11 pm
by logjam
Grimers: I think it is great you are trying to push the boundaries of the software, but as you have found out this is rather more complicated than it seems. However, 'Heat Index' is one set of data stored in the recent history array. The tag is <#RecentHeatIndex> (check out the Cumulus wiki) That data can be displayed on a user web page. It would also be possible to make a graph web page with javascript using this data too. Having been introduced to 'High Charts' on CumulusMX, I went to this web page http://www.highcharts.com/ and started at the beginning. After I eventually understood the principle, I put in the recent history tags from Cumulus and made my own charts. If a decrepit old has-been like me can do it, I'm sure an adventurous experimenter like you can!

Re: Adding Heat Index To Graphs

Posted: Tue 01 Dec 2015 1:10 pm
by Grimers
logjam wrote:Grimers: I think it is great you are trying to push the boundaries of the software, but as you have found out this is rather more complicated than it seems. However, 'Heat Index' is one set of data stored in the recent history array. The tag is <#RecentHeatIndex> (check out the Cumulus wiki) That data can be displayed on a user web page. It would also be possible to make a graph web page with javascript using this data too. Having been introduced to 'High Charts' on CumulusMX, I went to this web page http://www.highcharts.com/ and started at the beginning. After I eventually understood the principle, I put in the recent history tags from Cumulus and made my own charts. If a decrepit old has-been like me can do it, I'm sure an adventurous experimenter like you can!
Thanks for the information, I think we're going to have to revert to PM as I've just tried using that tag in the JS code to no avail.

Re: Adding Heat Index To Graphs

Posted: Tue 01 Dec 2015 6:24 pm
by logjam
I think you are making the same mistake as before. Cumulus doesn't provide that particular data to make the charts in that particular way. The tags I mentioned could only be used in your own High Chart script to make a graph. There are no short cuts if you want to make your own graphs. Take a look at the high charts web site and try some of the examples if you want to learn how to do it. Otherwise you will have to be content with the graphs that are provided.

Re: Adding Heat Index To Graphs

Posted: Tue 01 Dec 2015 7:11 pm
by Grimers
logjam wrote:I think you are making the same mistake as before. Cumulus doesn't provide that particular data to make the charts in that particular way. The tags I mentioned could only be used in your own High Chart script to make a graph. There are no short cuts if you want to make your own graphs. Take a look at the high charts web site and try some of the examples if you want to learn how to do it. Otherwise you will have to be content with the graphs that are provided.
I don't understand what you mean. If Cumulus MX cannot provide the data to the graphs then you cannot make graphs that will show that data surely?

Re: Adding Heat Index To Graphs

Posted: Tue 01 Dec 2015 11:35 pm
by philpugh
I would suggest you read the wiki (link at top of forum) to understand what data is made available via Cumulus e.g. the webtags. And how it is made available to we end users. There are lots of ideas contained in the forum,some easier to implement then others.

Re: Adding Heat Index To Graphs

Posted: Wed 02 Dec 2015 8:55 am
by Grimers
philpugh wrote:I would suggest you read the wiki (link at top of forum) to understand what data is made available via Cumulus e.g. the webtags. And how it is made available to we end users. There are lots of ideas contained in the forum,some easier to implement then others.
I have already read the Wiki looking for possible web tags to use in my website. I think no one really knows if you can add the data in, if Steve says it's not possible then I'd agree with him.

Re: Adding Heat Index To Graphs

Posted: Wed 02 Dec 2015 9:55 am
by mcrossley
No, Steve was saying that the data you wanted - Heat Index in this case - is not available in the built-in JSON data that MX supplies. But there is nothing stopping you creating your own data files using the 'recent' web tags.

Re: Adding Heat Index To Graphs

Posted: Wed 02 Dec 2015 2:24 pm
by Grimers
mcrossley wrote:No, Steve was saying that the data you wanted - Heat Index in this case - is not available in the built-in JSON data that MX supplies. But there is nothing stopping you creating your own data files using the 'recent' web tags.
Ok, I understand. Maybe I should of rephrased the question to: "How Do I Add Heat Index To Graphs?". How do you create the "data files". Do you mean that you have to create a new .json file and create the heat index data there as all I see when I open one of these files is a lot of numbers...

Re: Adding Heat Index To Graphs

Posted: Wed 02 Dec 2015 2:47 pm
by water01
creating your own data files using the 'recent' web tags
Mark said as above "using webtags", so make a file (say heatindexT.txt)using the Cumulus "recent" webtags, get Cumulus MX to "process" it and upload it (either as a realtime file or a normal upload file) and upload it as say heatindex.txt and then use the fields from that file in your code.

Re: Adding Heat Index To Graphs

Posted: Wed 02 Dec 2015 2:54 pm
by Grimers
water01 wrote:
creating your own data files using the 'recent' web tags
Mark said as above "using webtags", so make a file (say heatindexT.txt)using the Cumulus "recent" webtags, get Cumulus MX to "process" it and upload it (either as a realtime file or a normal upload file) and upload it as say heatindex.txt and then use the fields from that file in your code.
Oh! Sorry, I got confused on which files to be using, I'll have a fiddle! Thanks!

EDIT: I must be coding this either wrong or in the wrong place:

Code: Select all

$.ajax({
        url: 'tempdata.json',
        cache: false,
        dataType: 'json',
        success: function (resp) {
            chart.hideLoading();
            chart.series[0].setData(resp.temp);
            chart.series[1].setData(resp.dew);
            chart.series[2].setData(resp.apptemp);
            chart.series[3].setData(resp.wchill);
        }
	});
	$.ajax({
		url: 'heatindex.txt',
		cache: false,
		dataType: 'txt',
		sucess: function (resp) {
			chart.hideLoading();
			chart.series[4].setData(resp.recentheatindex);
		}
		});
Here is heatindexT.txt:

Code: Select all

{"recentheatindex":"<#RecentHeatIndex>"}