How to setup jpgraphs and wxgraphs

The warning is telling you to add a time zone setting line, like this:

date_default_timezone_set('Europe/London');

Be advised that a new version of JpGraph was released a few days ago (2016-08-09) - version 4.0.1 of JpGraph supports PHP5 (PHP 5.1.0 or higher version) and PHP 7.0.

Thanks R_o_b, good to know :slight_smile:

Hey - great - thanks - I’ve only gone and got it working!! :smiley:

http://www.hssc.net/weather/gauges.htm

Hi guys!

Yet another newbie with jpg-config.inc.php problems …

I have tried http://gudmundsbyn.se/jpgraph/src/Examples/testsuit.php with:

define(‘TTF_DIR’,‘/jpgraph/truetype/’);
define(‘TTF_DIR’,‘/customers/7/d/e/gudmundsbyn.se/httpd.www/jpgraph/truetype/’);
define(‘TTF_DIR’,‘${WEBROOT}/jpgraph/truetype/’);

with no luck :confused: fonts are not working.

I hope one of you spots my mistake or has a good idea re what I can try to fix this …

Thanks in advance /JensB

Try

define(‘TTF_DIR’,‘…/…/truetype/’);

or

define(‘TTF_DIR’,‘…/truetype/’);

Hi! Thnx for helping a n00b :slight_smile:

Tried both, no luck

What version of jpgraph?

Version: 4.0.1 (2016-08-09) jpgraph-4.0.1.tar.gz

I’ve never ventured past 3.5, I’ll have to look at that one.

Please attach a copy of your jpg-config.inc.php saved as jpg-config.inc.php.txt

I set up what I think is the same directory structure and

define('TTF_DIR','../../truetype/');

works for me :dontknow:

so many weird things … sigh

  1. when unpacking jpgraph-4.0.1.tar.gz with winrar on win7 I have to run winrar in Admin mode … because some file in the tar is seen as a symlink by windows. This results in the whole tar being unpacked again in jpgraph\src\Examples over and over.
    Seems like the culprit is jpgraph a zero byte file in /Examples/

  2. Deleted everything and started over now almost nothing works :slight_smile: http://www.gudmundsbyn.se/jpgraph4/src/Examples/testsuit.php

  3. Only thing I have changed in jpg-config.inc.php is the define(‘TTF_DIR’,‘${WEBROOT}/jpgraph4/truetype/’);

  4. Also found out that I can


jpg-config.inc.txt (5.89 KB)

I used 7zip to unpack it, had no issues.

In my experience you have to work through this step by step…

First, change the foldername from jpgraph4 to jpgraph, jpgraph4 may cause some confusion and we have enough already :lol:

Next, start with http://www.gudmundsbyn.se/jpgraph4/src/Examples/accbarex1.php change these two lines:

require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_bar.php');

to

require_once ('../jpgraph.php');
require_once ('../jpgraph_bar.php');

and see if that graph works.

http://www.gudmundsbyn.se/jpgraph/src/Examples/accbarex1.php

nope not working

<?php // content="text/plain; charset=utf-8"
require_once ('../jpgraph.php');
require_once ('../jpgraph_bar.php');

$datay1=array(13,8,19,7,17,6);
$datay2=array(4,5,2,7,5,25);

// Create the graph.
$graph = new Graph(350,250);
$graph->SetScale('textlin');
$graph->SetMarginColor('white');

// Setup title
$graph->title->Set('Acc bar with gradient');

// Create the first bar
$bplot = new BarPlot($datay1);
$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT);
$bplot->SetColor('darkred');

// Create the second bar
$bplot2 = new BarPlot($datay2);
$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT);
$bplot2->SetColor('darkgreen');

// And join them in an accumulated bar
$accbplot = new AccBarPlot(array($bplot,$bplot2));
$graph->Add($accbplot);

$graph->Stroke();
?>

same error when unpacking with 7zip 64bit (

something is wrong with permissions maybe?

hardpath.php works in http://www.gudmundsbyn.se/jpgraph/truetype/hardpath.php

but not in http://gudmundsbyn.se/jpgraph/src/Examples/hardpath.php

I don

I’m sorry, there’s something very wrong with all this and I don’t think I can be much help :frowning:

Well I am very happy with the advise you have been giving me! :slight_smile:

I

Check your PM for something that may help :slight_smile:

:multi: