Page 3 of 3

Re: Different time trends ?

Posted: Mon 04 Aug 2014 7:03 pm
by sfws
tempe wrote:My graph went missing thou
The version on my pc I used to test with is ok, so I don't know why yours is not.
I have tried deleting my copy and copying back the version 3 that I previously zipped up and that also works on my PC.
Maybe your download got corrupted?

I have produced a version 3.1 that slightly changes the handling of minutes on the x-axis again. But the main change is to the HTML paragraphs describing the graphs, I have tidied those up now. EDIT - version 3.1 originally posted here now removed as superceded by later version.

Duke - Just finished doing some watering with my hose and locked up the doors. The additional burden on me is I spend several days away from my garden because of some of my responsibilities. I might be interested in weather for why the showers miss me, but it is this coding lark that is annoying me by taking me away from the few hours I can be in the garden...

Re: Different time trends ?

Posted: Mon 04 Aug 2014 7:30 pm
by tempe
Now it works again, dont know what was wrong. However now the x-axis scale is wrong way and I dont seem to be able to flip the graphs to RHS by setting the reverse switch true or false. But this isnt a mayday so please take your time with garden by all means :)

Re: Different time trends ?

Posted: Mon 04 Aug 2014 7:40 pm
by tempe
Okey so I moved reversed: true down a bit (below one brackets) and now its flipped to RHS. However now the scale is flipped wrong too xD. Well, Ill experiment with it :)

Re: Different time trends ?

Posted: Mon 04 Aug 2014 7:51 pm
by sfws
I thought '7 days ago' was earliest and you wanted that on left side.

Code: Select all

				startOnTick: false,
				tickInterval: 24, // mark off days (24 hours)
				tickWidth: 3,
				labels: {
					formatter: function() { // function to convert 'string' hours into days for x-axis labels
						var hoursAgo=parseInt(this.value,10);
						var daysAgo=hoursAgo/24;
						//var dayNameArray=[],dayLabel;
						//dayNameArray= metDayName("<#dayname>");
						//dayLabel=dayNameArray[daysAgo]+' (Noon)';
						 var textAgo=(daysAgo==1)?daysAgo+' day ago':daysAgo+' days ago';// singular or plural
						 return textAgo;
						//return dayLabel;
					}
				},
				reversed: true
			},
			legend: {
determines what appears as labels on x axis. 'this.value' is the x-axis count from the left.
The 'reversed' property is true if the first value in your arrays is to be plotted on the right hand side, false if the y values are to be plotted left to right in the same order as they appear in the arrays declared for the series.

I did originally start the design for you with days of week shown, but that was really complicated to do with my original most recent on left and I gave up. I have days of week shown on my test version at noon each day , but it is a messy solution as the commented out bits in my code above suggest, so I have not shared it and perhaps someone else has a neater solution.
tempe wrote:Okey so I moved reversed: true down a bit (below one brackets) and now its flipped to RHS. However now the scale is flipped wrong too xD. Well, Ill experiment with it :)
With my posting of my first version I mentioned positioning of brackets was very tricky. Whilst I cannot be absolutely certain all my brackets are correct, (EDITED rest of this posting in light of reply to above part of this posting) I was surprised to see that I had got that wrong, but thanks for letting me know I had made a mistake again. Would those who download my version 3.1 be aware they need to apply the correction that you have applied by moving reversed: true to new position as shown in code example above (ignore extras that I have commented out about day names) and make change mentioned in next reply.

I have a busy few days now so I will not be doing any experimenting nor correcting of my zipped version 3.1.

You've now shown a tooltip successfully, you can match values shown in that tooltip against what you see if you use View menu, Data Logs option and load the Aug14log.txt file.

Re: Different time trends ?

Posted: Mon 04 Aug 2014 7:56 pm
by tempe
Yes I changed var hoursAgo=168-parseInt(this.value,10); to var hoursAgo=parseInt(this.value,10); and positioned the reverse switch one bracket down so it would affect x-axis instead of labels, now it works perfectly! New data on the right side. Thanks! And sorry if I my writings were confusing, probably didnt make myself clear which way etc it should be :)

Re: Different time trends ?

Posted: Mon 04 Aug 2014 8:14 pm
by duke
I might be interested in weather for why the showers miss me
They miss you too....

Re: Different time trends ?

Posted: Thu 07 Aug 2014 8:52 pm
by sfws
This thread was moved into "3rd Party tools" sub-forum because it drifted away from its original query in Cumulus main forum of what Cumulus software could do, with this experiment by me on how 'recent history' tags and 'Highcharts' scripts could be combined.

In '3rd party tools' you will find there is a new topic at https://cumulus.hosiene.co.uk/viewtopic.php?f=18&t=12321 that will contain any newer versions of my variant on 'trendsT.htm', so I no longer support anything that was in this thread.

Re: Different time trends ?

Posted: Wed 13 Aug 2014 6:07 am
by sfws
Back to original subject on this topic ...http://sanday.org.uk/weather/trends.htm
Has anyone else noticed that Cumulus 3 seems to be proposing to replace thumbnails with buttons and use a different approach for the large graphs?

Whilst I have not had time to study 'cumuluscharts.js' to work out where the data points come from, there is presumably some scope for tailoring the graph to some different periods?

Re: Different time trends ?

Posted: Wed 13 Aug 2014 6:38 am
by steve
sfws wrote:Has anyone else noticed that Cumulus 3 seems to be proposing to replace thumbnails with buttons and use a different approach for the large graphs?

Whilst I have not had time to study 'cumuluscharts.js' to work out where the data points come from, there is presumably some scope for tailoring the graph to some different periods?
The data comes from JSON files generated and uploaded automatically by the new version of Cumulus. Yes, it would definitely be possible to allow different time periods, and I was going to add that to the first release, but as I still have quite a bit to do on the user interface (which has the same graphs), I decided I would leave that for further enhancement later on.

Re: Different time trends ?

Posted: Wed 13 Aug 2014 7:27 am
by duke
Slightly off topic - sorry. Steve, you hinted in an earlier post that the new Cumulus would have a different 'webtag' template/format. Is it possible you could release a preview/version of that for us that use PHP for our sites to look at?

Re: Different time trends ?

Posted: Wed 13 Aug 2014 8:22 am
by steve
The web tags are 99% the same as in the current version, and the templates are the same apart from the gauges (I'm using Mark's SteelSeries) and the graphs.

The main difference with the web tags is the date/time 'format' parameter. The current version uses Delphi format specifiers, and the new version uses .Net; there's a page describing them here - http://msdn.microsoft.com/en-us/library ... .110).aspx

The differences come about because Delphi is case-insensitive, and .Net is case sensitive, so .Net can use upper and lower case for different items, where Delphi has to use different letters. For example, in Delphi, "nn" means "minutes", and this will need changing to "mm". "hh" in Delphi is the hour in 24-hour format, and in .Net it's "HH".

The other change with the "format" parameter is the different way that .Net escapes characters which are not to used as format specifiers. In Delphi you put the 'verbatim' characters inside single quotes; in .Net you escape each verbatim character with backslashes.

I might be able to produce a converter if the above is a serious issue.

Re: Different time trends ?

Posted: Wed 13 Aug 2014 9:01 am
by duke
Thanks for your explanation Steve, I would have to read a bit more later on but it would appear to me that the 'replace all' facility in the average web page editor or Notepad++ would easily be able to deal with this once we are aware of all the differences.