installation and sample chart problem
Hi,
I am very new with pChart, and not really good in Php
I tryed to install pChart but and print a simple chart in a simple test php page.
my problem is that it seems that when i include the .class.php files, it doesnt work.
Code:
<?php
echo test1;
if ((include 'localhost/website/lib/pChart/class/pDraw.class.php') == 'OK') {
echo OK;
}
echo test2;
include("//localhost/website/lib/pChart/class/pDraw.class.php");
include("//localhost/website/lib/pChart/class/pImage.class.php");
include("//localhost/website/lib/pChart/class/pData.class.php");
echo test3;
$myDataset = array(0, 1, 1, 2, 3, 5, 8, 13);
echo test4;
$myData = new pData();
echo test5;
$myData->addPoints($myDataset);
echo test6;
$myImage = new pImage(500, 300, $myData);
echo test7;
$myImage->setFontProperties(array(
"FontName" => PCHART_PATH . "/fonts/GeosansLight.ttf",
"FontSize" => 15));
$myImage->setGraphArea(25,25, 475,275);
$myImage->drawScale();
$myImage->drawBarChart();
header("Content-Type: image/png");
$myImage->Render(null);
echo test12;
?>
I put some echo each lines to see where it do not work and it seems to block at the "new pData" and the include does not seems to work as the following code doesnt print OK,
Quote:
if ((include 'localhost/website/lib/pChart/class/pDraw.class.php') == 'OK') {
echo OK;
}
Can someone explain me what is my problem or how to solve it that should be very simple... the library GD is enable.
Thank you.