How to setup jpgraphs and wxgraphs

I’ve been grabbing Chuck’s clientrawhour.txt for a while, the data is definitely shuffling left, see below (time stamp at the start of the record is my capture time). If it’s going to do this I think it needs a time stamp added so that the data can be interpreted correctly.

yes there is an otion to have the clientrawhour.txt updated every 5 minutes, and so then its the 60 minutes prior to that every 5 minutes

The problem is that the Broadstairs wxgraphs put times on the x axis that assume that the last data element is 59 minutes past the hour. That used to be a good assumption, but now there’s no knowing what the time stamps should be.

Yes its going to be a problem knowing what that timing is, it may be possible from the timestamp on the file but even then the tie wont be that accurate. I wonder how Julian works out what to use for the time axis? Right now I cant remember howq I made the timestamp. I’ll have a look later today and see what I can do.

Stuart

Stuart,

Do you want me to send you my old 1 hr graphs to take a look at. Let me know.

Chuck

WDL doesn’t use a real timestamp, the axis runs from -60 to 0.

Well in that case WDL is showing an invalid x axis on my graphs because my clientrawhour.txt is only updated once per hour at 59 minutes past the hour, so I’ll raise a thread for Julian to look at. As for the graphs I’ll look later at how I might do it.

Stuart

Please see this thread for Julian’s comments on the clientrawhour.txt problem. Since we are using data which Brian creates for WDL I’m inclined to leave the jpgraph code as is for now and wait for the outcome of this other thread. Julian seems to feel a timestamp is needed.

Stuart

Yes, I agree, a time stamp would be the best solution.

Im getting there on setting up these graphs…

http://www.snoqualmieweather.com/wxgraphs/rain_1hr.php

There error Im getting is for the fonts. But I cant seem to find in what file to change the path to my folder where the fonts are. If anyone knows off hand, that would be great. Thanks, Mark.

UPDATE: I got it fixed…Now onto other issues…lol

Got to your jpgraph.php under the src folder and look for this. See the last line DEFINE(‘TTF_DIR’,‘/virtual/users/e14497-14796/web/graphs/jp/ttf/’); thats where you configure your fonts. This is the way I have it set up. Mine is around line 46 or so.

if (!defined('TTF_DIR')) {
    if (strstr( PHP_OS, 'WIN') ) {
	$sroot = getenv('SystemRoot');
        if( empty($sroot) ) {
	    $t = new ErrMsgText();
	    $msg = $t->Get(12,$file,$lineno);
	    die($msg);
        }
	else {
	  DEFINE('TTF_DIR', $sroot.'/fonts/');
        }
    } else {
	DEFINE('TTF_DIR','/virtual/users/e14497-14796/web/graphs/jp/ttf/');

Chuck

Thanks Chuck…I got that figured out…Now im trying to get them all aligned on my page…The bottom graphs are shifting to the left…So thats what Im fighting with now…Then Id like to work on changing the backgrounds on the graphs themselves.

a temp page

http://www.snoqualmieweather.com/pagetemplate.php

I had JPGraphs on my old site…Graphweather makes much better looking ones without all the hassle. Just my humble opinion :smiley:

trying to set these graphs back up on php v5 and I’m getting a weird error. They worked no prob on v4. i did download the files for v5, so thats not a problem. Heres the link with the error…

http://www.snoqualmieweather.com/wxgraphs/baro_7days.php


if ($family >= FF_MINCHO && $family <= FF_PGOTHIC) {                      <<<<<<Line 386
	    $f = MBTTF_DIR.$f;
	} else {
	    $f = TTF_DIR.$f;


I have all the fonts and folders in the right place, just like how they were when I had v4.

Any ideas would be great…Thanks, Mark.

Mark,

I took a look at your page source and the the graphs path are different on a couple not sure if that is the issue. I assume they are all in the same directory.

[b] [/b] [b] [/b] <[b]td>[/b] [b] [/b]
<td><img src="./wxgraphs/solar_24hr.php /"></td>

Chuck

I did that yesterday messing with it cause of a directory change, but that didnt affect anything. The link I provided in my previous post is a direct link to a graph. if it works there, then it should work on the page.

Did you check your jpg-config.inc.php and set the directories. I assume that you did. Sorry if I am repeating things. It could be something to do with the new file because I do not have it jpgraph_ttf.inc.php.

// Directories for cache and font directory.
//
// CACHE_DIR:
// The full absolute name of the directory to be used to store the
// cached image files. This directory will not be used if the USE_CACHE
// define (further down) is false. If you enable the cache please note that
// this directory MUST be readable and writable for the process running PHP.
// Must end with ‘/’
//
// TTF_DIR:
// Directory where TTF fonts can be found. Must end with ‘/’
//
// The default values used if these defines are left commented out are:
//
// UNIX:
// CACHE_DIR /tmp/jpgraph_cache/
// TTF_DIR /virtual/users/e14497-14796/web/graphs/jp/ttf/
// MBTTF_DIR /usr/share/fonts/ja/TrueType/
//
// WINDOWS:
// CACHE_DIR $SERVER_TEMP/jpgraph_cache/
// TTF_DIR $SERVER_SYSTEMROOT/fonts/
// MBTTF_DIR $SERVER_SYSTEMROOT/fonts/
//
//------------------------------------------------------------------------
// DEFINE(“CACHE_DIR”,“/tmp/jpgraph_cache/”);
// DEFINE(“TTF_DIR”,“/virtual/users/e14497-14796/web/graphs/jp/ttf/”);
// DEFINE(“MBTTF_DIR”,“/usr/share/fonts/ja/TrueType/”);

Chuck

i do have this under the main section where it says to change it…

// define(“TTF_DIR”,“/virtual/users/e16108-17165/web/jpgraph-2.3.4/ttf/”);

But I didnt change the windows or unix section. i never had to do that before.

Here is another repeater probably. Under the jpgraph.php. Just trying to cover everything I can think of. :wink:

if (!defined(‘TTF_DIR’)) {
if (strstr( PHP_OS, ‘WIN’) ) {
$sroot = getenv(‘SystemRoot’);
if( empty($sroot) ) {
$t = new ErrMsgText();
$msg = $t->Get(12,$file,$lineno);
die($msg);
}
else {
define(‘TTF_DIR’, $sroot.‘/fonts/’);
}
} else {
define(‘TTF_DIR’,‘/usr/share/fonts/truetype/’);
}

Chuck

Yeah…thats the same. Im starting to wonder If its the fonts I uploaded from the windows folder. But ive uploaded new font files. But for some reason, i think they may be the problem.