View unanswered posts | View active topics It is currently Wed May 15, 2024 4:52 am



Reply to topic  [ 4 posts ] 
installation and sample chart problem 
Author Message
New pChart user
New pChart user

Joined: Mon Dec 12, 2011 12:09 pm
Posts: 3
Post 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.


Mon Dec 12, 2011 12:17 pm
Profile
Regular pChart user
Regular pChart user

Joined: Tue Jun 07, 2011 1:43 pm
Posts: 12
Post Re: installation and sample chart problem
The include needs to be for your disk - not Http: request path
this path looks weird
## include 'localhost/website/lib/pChart/class/pDraw.class.php'

more likley something like (assuming linux server)
include '/var/www/website/lib/pChart/class/pDraw.class.php'

If that does not help. put something like
error_reporting(E_ALL);
ini_set('display_errors', '1');
at the beginning of your file and you will probably work it out from the error messages.

Hopefully that helps.

Matt :)


Mon Dec 12, 2011 1:46 pm
Profile
New pChart user
New pChart user

Joined: Mon Dec 12, 2011 12:09 pm
Posts: 3
Post Re: installation and sample chart problem
Thx for your rapid answer!

One thing that i don't understand, like if a path for the include on my local disk, how will it gets it once my website on the online server? sorry it looks dumb question.. :)

Could you show me a path exemple for windows.

Doing what you told, in the relevent errors i had this one:
Quote:
Warning: include(): Failed opening 'class/pDraw.class.php' for inclusion (include_path='.;C:\php\pear') in C:\Inetpub\wwwroot\website\test.php on line 9


Another idiot question, the folder of pChart unzipped has to be in the Php folder??

Thank you again for your help.

Steph


Mon Dec 12, 2011 2:07 pm
Profile
New pChart user
New pChart user

Joined: Mon Dec 12, 2011 12:09 pm
Posts: 3
Post Re: installation and sample chart problem
Quote:
Warning: include(../wwwroot/website/lib/pChart/class/pDraw.class.php): failed to open stream: No such file or directory in C:\Inetpub\wwwroot\website\test.php


Mon Dec 12, 2011 2:12 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron