The scripts use the JPGraphs file caching system, the images are generated on demand, but pulled from the cache if the previous version is within the time (default is 10 minutes). I didn't like the overhead of a cron job endlessly redrawing them if nobody needs them.
Most of the settings you need to alter are in the graphSettings.php script.
I have included a .htaccess file so that if you have an Apache server, you can get the scripts via the image names used in C1 (plus some extra variations).
Please note, I have found that JPGraphs ver 3.5.0b1 has a bug in the caching system. The fix for the bug is to edit "gd_image.inc.php", and add a 'return true' at line 2266 in the function GetAndStream()...
Code: Select all
function GetAndStream($aImage,$aCacheFileName) {
if( $this->Isvalid($aCacheFileName) ) {
$this->StreamImgFile($aImage,$aCacheFileName);
return true;
}
else {
return false;
}
}
Note: The get the Wind Rose plot working correctly, I had to add the arial.ttf and verdana.ttf font files to the JPGraphs font folder.
PS. If you want some much nicer looking jpgraph based graphs for displaying on a page, then Kevin at TNET Weather has a template for download. They will need adapting to use the MX json files though.
I have moved the source for these graphs onto GitHub, feel free to download them from there, and branch/modify to your hearts content. I'll merge back any updates that you think are of value to others - like adding a readme and how-to guide!
https://github.com/mcrossley/Cumulus-MX-Gauge-Graphs/