WU Graphs

  • Data source: Wunderground or MySQL Weather Display database
  • Graph switching with jQuery tabs and Ajax support
  • Interactive Year, Month and Day graphs
  • Caching. Without caching, from Wunderground data source is load time 2.5 - 12s (or even more - depends on actual load of Wunderground.com server). The cached WU content is loaded x-times faster (load time is +/-0.5s on my site). Same thing for MySQL WD data source.
  • Themes support
  • Datepicker for easy date selection
  • Time and Y-axis value in tooltips
  • Zooming in graph
  • Cookies support (saving selected graph tab, selected day/month/year in graph and language)
  • Separate graph window with custom sizing (linkable date, size and language)
  • Integration for Saratoga/CarterLake templates with language switch support
  • Custom extra text information for each graph in html format.
  • English/Metric units support (otherwise depends on the location of the server and its cookies)
  • Auto version checker
  • Many configurable features and some minor functions and other settings
  • Nice look :-)

Actual languages in package:
CZECHDANISH (by jwwd at silkeborg-vejret.dk)
DUTCH (by leudalweer.nl and jacg)ENGLISH
FINNISH (by Pby11 at helmroos.com)FRENCH (by celin-web.com)
GERMAN (by celin-web.com)GREEK (by atsio at meteothes.gr)
HUNGARIAN (by huweather.com)ITALIAN (by meteocarmignano.it)
NORWEGIAN (by bredesen-vestby.no)PORTUGUESE (by Manuel Raimnundo at meteoelvas.com)
ROMANIAN (by celin-web.com)SERBIAN (by Dejan Tikvicki at sumeteo.info)
SLOVAK (by pocasiemost.vija.sk)SLOVENIAN (by Marko Kodelja at okroglovreme.com)
SPANISH (by Manuel Raimnundo at meteoelvas.com)SWEDISH (by Pby11 at helmroos.com)

If you create new language files please send them to luzar [at] post [dot] cz
Did you find and correct bad translation? Please send it to luzar [at] post [dot] cz.

Languages which will added in next version: none at this time -> this list is updated periodically as I get new Translations.

  • Weather station submiting data to Weather Underground or Weather station using Weather Display program and MySQL database.
  • PHP >= 5.1.0 (tested on Linux version 5.2.0-8, windows v 5.3.1)
    may work on older versions of PHP5

Short installation guide
  1. Download and unpack wug.zip to your hard drive
  2. Copy directory "wxwugraphs" and file "wugraphs.php" or "wxwugraphs.php" (for Saratoga/Carterlake templates) to root of your website.
  3. In directory wxwugraphs, make the directory "cache" writable for PHP (chmod 777)
  4. Open http://www.yoursite.com/wxwugraphs/configurator.php in your browser (default password is "wugraphs") and set & save graph configuration. If you have problems with configurator page, you can edit file "WUG-settings.php", but don't use Windows Notepad
  5. Open http://www.yoursite.com/wxwugraphs/WUG-test.php in your browser and check if everything is correct
  6. Check graphs start page - http://www.yoursite.com/wxwugraphs.php or http://www.yoursite.com/wxwugraphs eventually http://www.yoursite.com/wugraphs.php
  7. Done

  • Configuration page is available from every WU Graphs page using by URL parameter config=1. For example: http//yoursite.com/wugraphs.php?config=1
  • To recreate stored cache for given day/month/year use URL parameter "force=1"
  • If you want remove whole graphs cache, go to WU Configuration page (http://yoursite.com/wugraphs?config=1) and there is section Other/malfunction settings with button for removing whole cache.
  • If you want add extra text (eg: info about measuring) to some graph, then you can create html file with graph filename prefix. eq: "graphy6a.html". For other language you can create file with graph filename prefix and language suffix separated with dash (graph*a-**.html). eq for German: "graphy6a-de.html" These files would have UTF-8 enconding format.
    Extra text file search sequence:
    - exists extra text language file (graph*a-**.html) for actual language?
    -- if yes then load this file. if no, then verify if graph*a.html file exists.
    --- if graph*a.html exists then load it.
  • All WU Graphs php files are in UTF-8 charset and must be without a BOM. So don't edit these files in Windows notepad. (Notepad add a BOM by default)
    More info about BOM: 1 , 2
    You can try better free editor like a PSPad, Notepad++ etc...
  • New translation: Copy WUG-language-en.php (located in languages dir) to new filename with suffix of yor language (ISO 639-1 ). Eg for german copy "WUG-language-en.php" to "WUG-language-de.php". Then translate new created file, copy it to yor website, run http://yourwebsite.com/wxwugraphs/WUG-test.php and check your language. If is missing "Used Datepicker language file", then you need also create new translation file in "language/datepicker" directory (copy, rename and translate "jquery.ui.datepicker-en.js" to your language).
    Next step is generating new langlist.php file:
    • Option 1: Send language files to My email address. New language will be added to next version of WU Graphs.
    • Option 2: Make sure that file wxwugraphs/languages/langlist.php is writable for PHP (chmod 666). Run generator for langlist.php using browser at addres http://yourwebsite.com/wxwugraphs/languages/lgen.php . Now you can change file attributes (chmod) of langlist.php to 664.
    • Option 3: Or add to file wxwugraphs/languages/langlist.php your new language info.
download Download latest version 1.8.0
(707.4 KB)
This script has been downloaded times

FAQ - Frequently Asked Questions
Q: I installed WU Graphs but "Sun" tab doesn't show data for monthly and yearly views. The Daily view seems to work.
A: Month and Year sun graphs are recalculated from day data. You must retrieve data from a few more days to see these graphs. Therefore, it is advisable to activate "precache" function that retrieving WU day data for other days when visitor browsing at graph pages.

Q: The sun tab is not visible for monthly and yearly views.
A: This is normal. You have enabled "Solar graphs" and disabled "Calculate avg solar radiation" in your configuration. See text in WU graphs configurator.php for "Calculate avg solar radiation":
Calculate values for month/year graphs from daily data. If is enabled solar graphs and this feature, then solar tab appear in month/year graphs.

Contacts, Discusion
Feature requests, support and discusion on weather-watch.com forum topic
e-mail: luzar [at] post [dot] cz
or you can use Contact form on this website

Sites using these graphs
saratoga-weather.org, www.meteocarmignano.it, travelingrvwx.com, gateway2capecod.com, planoweather.com and many others
http://pocasi.hovnet.cz (author's website)

If you use this script please send me your details and I will add your site to this list.

  • Actually nothing to do.

Key construction (powered by)

Many thanks to Jan Spruijt for the inspiration of this graphs system.
Also thanks to PBY11 for tests and support at weather-watch.com forum.
And thanks to donors: Torjan Heradstveit, Helge Helmroos, Jonny Larsson, Søren Knudsen, Brad Morton, Adrian Hudson, David Watts, Lauren Daly and more.
Whole donors list:
Willem van der Kuil, Georg Andersen, Ronald Ingebrigtsen, The Crystal Ridge Company, Adrian Hudson, Jarmo Karjalainen, Trevor Moore, David Watts, Arnold Simpson, Helge Helmroos, Lauren Daly, Brad Morton, søren Knudsen, Jonny Larsson, Torjan Heradstveit.
Version History

Public releases:
  • v 1.8.0 (2011/09/05 11:30 UTC)
    Transparent background choice for theme in configurator (from now default value); Added "Combined" datasource - useful if you started using WD MySQL and you want to have also available older data from Wunderground data source ; Added Portuguese and Serbian translation + updated Spanish translation ; Added preloader image when is graph loaded ; Removed blinking when graph is loaded ; Added support for datetime column in WD MySQL ; Fixed problem with WUG-ver.php and PHP servers configured with allow_url_fopen = off ; Fixed theme problem in Baro hour graphs ; Improved UV graphs look (changed to gradient area type); Fixed error in hour graphs (for clientrawhour source) if data is not numeric ('-' for missing measured values); Added language switch to Windowed mode ; Fixed saving problem in configurator for colorpicker ; Improved dependencies in configurator.php ; Small php optimization and bugfixies
  • v 1.7.0 (2011/08/05 06:30 UTC)
    Added UV plot to Sun graphs (only for WD MySQL data source) ; added ability to show indoor temperature plot (only for WD MySQL data source) ; Added ability to change the background color and font color using color picker at WU Graphs configurator page ; Added new theme 'Pepper' ; fixed tooltip rouding in precipitation graphs ; Added feature for disabling minimum and maximum limits for barometric pressure ; Higcharts plugin upgrade from 2.1.4 to 2.1.6 - few improvements and bux fixies ; fixed theme problem in window mode ; improved cache control for tabs ; improved error handling for WD MySQL requests
  • v 1.6.0 (2011/06/02 20:00 UTC)
    added theming support (actually is in WU Graphs package included two themes: "default" and "dark"); added support for PHP servers configured with allow_url_fopen = off ; improved support for servers without PHP multibyte string functions ; fixed few bugs in wunderground precaching ; updated finish and swedish translations ; added greek translation ; fixed some javascript problems (unexpected commas) in Internet Explorer
  • v 1.5.2b (2011/05/29 16:45 UTC)
    fixed bad date in calculated month/year graph data if is precache enabled ; small letters protection for WUID imput in configurator.php ; fixed some higcharts translation problems ; updated nl translation ; fixed zero day in month rain graph ; fixed/improved cache recreation for WD MySQL data source
  • v 1.5.1b (2011/05/27 22:30 UTC)
    added configuration for metric wind speed units (m/s or km/h) ; fixed bad daily rain values ; fixed empty daily wind and sun values (missed global in function in wug-parser-d.php) ; fixed mysql query for hour graphs ; fixed bad variable for remote db host connection
  • v 1.5.0b (2011/05/27 12:30 UTC)
    WD MySQL graph data source support ; upgrade to Highcharts 2.x - added image/pfd exporting and printig feature ; added auto precache function for WU day data ; added hour graphs (data from clientrawhour.txt or MySQL database), added configuration page, added de, se, fi, nl ... translations ; added language switch ; improved look in few graphs ; added solar radiation graphs for month and year interval ; added calculation for average barometric values in month and year graphs ; added wind direction to month and year wind speed graphs ; added rain sum in year/month precipitation graphs ; added switch 'line'/'spline' for graph drawing. All 'spline' style grahps are now 'line' graphs in default configuration - better graph accuracy especially if is time gap in source data, but worse look in some cases ; fixed problem with special characters in translated pages (added mb_ string funcions in PHP + extra PHP header and gathering charset info from saratoga/carterlake templ.) ; added 12h/24h time configuration ; spiked data correcting options ; improved and repaired WUG-test.php ; added option to disable PHP cookies for problems with PHP "mod_security" ; patched few WU caching bugs ; improved iframing system - less support files ; improved css for too narrowed webpages ; all scripst are now W3C compliant ; fixed parser for bad (Weather SW or WU) solar data ; and many more little fixies...
  • v 0.7.9b (2010/07/29 19:30 UTC)
    added sk, fr, ro, es traslations ; modified wunderground link - now refers to the historical data of your station ; custom date format in tooltips ; wxwugraphs and wugraphs.php are now W3C compliant (W3C for windowed mode will be in next version) ; added charset setting in WUG-settings.php (only for special purposes and currently untested)
  • v 0.7.8b (2010/07/28 19:00 UTC)
    fixed functionality bug for older browsers (eg IE7) ; fixed bug in language switch ; improved language switch - now you can use URL parameter "lang" for switching languages in standalone mode ; added tips/information text in italian translation
  • v 0.7.7b (2010/07/28 07:00 UTC)
    fixed bad decimal place in graphy6a.php and graphm6a.php for amount of rain in english/imperial units, added three new languages (dk, hu, it) ; added date format for day graphs in WUG-settings.php + improwed default values ; fixed parser for sun data ; improved today value in datepicker (now restricted to timezone of weatherstation).
  • v 0.7.6b (2010/07/27)
    fixed some css and html issues, better default configuration in WUG-settings.php, fixed iframe path in iframe-inc.php
  • v 0.7.5b (2010/07/26)
    first beta, fixed language support bug, improved avg baro (removed intermediate day cache)
Not dated internal releases:
  • v 0.7.0a - more configurable features, fixed timezone bug, added WUG-test.php, fixed english/imperial units conversion
  • v 0.6.5a - iframe autoheight support for inserted custom text, other font, graph size, etc...
  • v 0.6.0a - english units support, JS data parser, version checker, calculate avg Baro
  • v 0.5.0a - improved graphs design, multilinguage and custom text support
  • v 0.4.0a - datepicker, cookies date saving, windowed mode
  • v 0.3.0a - united config and *-inc files
  • v 0.1.0a - tabbed design, WU file caching

If you find this script useful to you, please consider making a small donation to help offset my time working on them.
Thanks for your kind support!