JPGraph error help

I have been trying to get JPGraph to work on my website, I have followed instructions and have the arial.ttf and arialbd.ttf uploaded from my windows fonts directory to my web server running PHP 5.1.6.

I ran a font test script from the ttf directory and it passed “PASS: Successfully read font file “/var/www/vhosts/mangawhaiweather.co.nz/httpdocs/jpgraph/ttf/arialbi.ttf”.”

but when I run http://www.mangawhaiweather.co.nz/wxgraphs/wxgraphs_test.html I get JPgraph error font does not exist or readable :?

If you look at those error messages they are looking for the files in /httpdocs/jpgraph but you have put them in /httpdocs/jpgraph-2.3.4 so it can’t find them.

Hi Niko

I have just changed the paths to jpgraph in case i had made a typo error. jpg-config-inc.php and graphsconf.php now have /var/www/vhosts/mangawhaiweather.co.nz/httpdocs/jpgraph/ttf but still get error

http://www.mangawhaiweather.co.nz/wxgraphs/wxgraphs_test.html

I ran this as well http://www.mangawhaiweather.co.nz/jpgraph/src/Examples/testsuit.php
and some graphs show but some do not and have the font error.

What have you got set in jpg-config.inc.php for the TFF location?
It should be somthing like this:

// DEFINE("CACHE_DIR","/tmp/jpgraph_cache/");
DEFINE("TTF_DIR","${WEBROOT}/jpgraph/ttf/");
// DEFINE("MBTTF_DIR","/usr/share/fonts/ja/TrueType/");

Hmmm, /jpgraph/ttf or just /jpgraph ? I’m not sure if the error message is overflowing the display box.

My jpg-config.inc.php looks like this:

// define(“CACHE_DIR”,“/tmp/jpgraph_cache/”);
define(“TTF_DIR”,“/var/www/vhosts/mangawhaiweather.co.nz/httpdocs/jpgraph/ttf”);
// define(“MBTTF_DIR”,“/usr/share/fonts/ja/TrueType/”);

I think it’s because you’re using PHP 5.1.6 on the server and that has problems with reading the direct root, try changing it to what I’ve already posted or, if that doesn’t work then try:

// DEFINE("CACHE_DIR","/tmp/jpgraph_cache/");
DEFINE("TTF_DIR","${WEBROOT}/httpdocs/jpgraph/ttf/");
// DEFINE("MBTTF_DIR","/usr/share/fonts/ja/TrueType/");

If neither work then you can change it back but I think it’s just a linking problem with the location of TFF folder.

Edit: I’ve just noticed that you don’t have a trailing “/” at the end of your link so try that first!!

// define(“CACHE_DIR”,“/tmp/jpgraph_cache/”);
define(“TTF_DIR”,“/var/www/vhosts/mangawhaiweather.co.nz/httpdocs/jpgraph/ttf/”);
// define(“MBTTF_DIR”,“/usr/share/fonts/ja/TrueType/”);

yes that done it, trailing link was missing.

Thanks for help :slight_smile:

Good stuff. :smiley:

I used some of those JPGraphs for the WAP graphs page on my site. :wink: