Page 1 of 5

Yearly Data Summary

Posted: Sun 06 Mar 2011 4:00 pm
by daj
I was reading a post on here a few days ago and someone was looking for a way to summarise yearly data in a table. I thought I would set myself a little challenge to do this, but also not to use PHP as not everyone has it enabled on their webservers.

The result is a pure HTML & Javascript page. No database needed, just the dayfile.txt on your webserver. An example of what I 'threw' together is here.

And of course, I wrote a wiki page as I ended up adding several options to customize it. Colours, layout, data sets and how to change from English to another language are all inlcuded in the wiki.....AnnualDataSummary

UPDATE -- a PHP verison is now included giving you the choice of which one to use

Re: Yearly Data Summary

Posted: Sun 06 Mar 2011 4:11 pm
by nitrx
Great job David :clap: , saw you also implented the different separators , will soon give it a try, works fine in IE9 too.

edit works fine with mine delimiters http://www.apeldoorn.tk/weer/datasummary.html

Re: Yearly Data Summary

Posted: Sun 06 Mar 2011 4:28 pm
by nitrx
For some reason you don't count values between 0,1 and 1 as a value by rain and wind ;)

Re: Yearly Data Summary

Posted: Sun 06 Mar 2011 4:34 pm
by daj
nitrx wrote:For some reason you don't count values between 0,1 and 1 as a value by rain and wind ;)
A possible failing in the Javascript -- on mine it treats 0.1 as a value and shows it. On yours it does not so I assume Javascript has a problem with 0,1 as a value. I will see what I can do

Re: Yearly Data Summary

Posted: Sun 06 Mar 2011 5:01 pm
by steve
Very good. I get frustrated sometimes that I don't have time to try the 'add ons' that people produce, but this looked so good, and so easy to set up that I had to give it a go.

http://sanday.org.uk/weather/datasummary.html

I added the units to my headings :)

Re: Yearly Data Summary

Posted: Sun 06 Mar 2011 5:05 pm
by bnwrx
Thank you David,(again!!). This is great for us NON-PHP people. :clap: :clap:

Should we add the dayfile.txt to those files Cumulus uploads to the website?

Re: Yearly Data Summary

Posted: Sun 06 Mar 2011 5:17 pm
by rayauger
That looks great. Thanks for the effort and thanks for keeping the none-php people in mind.

Is there a routine somewhere so we can chart those data ? Someone ever used Google charts ?

Yvan

Re: Yearly Data Summary

Posted: Sun 06 Mar 2011 5:44 pm
by daj
steve wrote:I added the units to my headings :)
Yeah -- the units are not included in the dayfile so I had no reference -- this was why I ended up giving an easy was to customize the headings; then I decided to allow all the text to change.

Re: Yearly Data Summary

Posted: Sun 06 Mar 2011 5:47 pm
by daj
bnwrx wrote:Should we add the dayfile.txt to those files Cumulus uploads to the website?
NO

This would upload your dayfile every 10 minutes (or however often Cumulus updates the site)

I use Cumulus Toolbox -- which is a bit of over kill just for this simple task, but I use toolbox for other stuff too. I guess we could do this one job with the windows scheduler task.

Re: Yearly Data Summary

Posted: Sun 06 Mar 2011 6:50 pm
by PaulMy
Excellent, thank you David. Got it to work and also started to use Toolbox :clap:

One observation; for the years I have full 12 months data (2009 and 2010) then for the Min/Max tab whenever there is a date that has low temperature of lower than -9.9 which has 5 charactors (i.e. -10.0) then the data is shown on 2 lines with the '-' sign on the 1st line and the 10.0 on the second line. This does not occur for years where I do not have full year's data - i.e. 2008 when first started Cumulus and this year when we are only into March. Not sure if that is my monitor, or if another setting issue?

Paul

Re: Yearly Data Summary

Posted: Sun 06 Mar 2011 7:13 pm
by daj
Paul

It could be any one of a number of things -- basically the text is wrapping as it can not fit it in the cell.

You could edit the dataSummary.css

Code: Select all

#table_container .smallfont { font-size: 70%;}
Drop the 70% to 65% or less, but it is getting a little small. This is the code used when it is displaing the min/max temp. together.

Alternatively increase the size of each cell slightly

Code: Select all

#table_container table td,table th {
	width: 65px;
Maybe 70 pixels

But if you increase the size, the table may need to get bigger too

Code: Select all

#table_container {
	width: 900px;
try 1000px

Your browser could also be affecting it depending on zoom and screen resolution, but less likely

Re: Yearly Data Summary

Posted: Sun 06 Mar 2011 7:22 pm
by steve
If it helps the diagnosis, Paul's page looks fine from here.

Re: Yearly Data Summary

Posted: Sun 06 Mar 2011 7:26 pm
by SouthUistWX
Thanks daj, that's just great

Been amusing myself playing around with this and it's not looking too bad: http://www.southuist-weather.info/wxdataannual.html and comparing it to how the TNET tabular data looks (php): http://www.southuist-weather.info/wxdata.php

Using Cumulus Toolbox works really well for uploading the dayfile.txt once a day

Re: Yearly Data Summary

Posted: Sun 06 Mar 2011 7:32 pm
by PaulMy
David, set the smallfont to 60% and now all on 1 line. Text getting a little small so may experiment with the table settings, etc. now that I've got a feel of such settings :oops: . Thanks very much.

Paul

Re: Yearly Data Summary

Posted: Sun 06 Mar 2011 7:55 pm
by Synewave
Bloomin' excellent. Just what my site was missing, and I didn't want to get into SQL etc. Well done David and thank-you! :clap: