View unanswered posts | View active topics It is currently Thu Mar 28, 2024 10:00 pm



Reply to topic  [ 2 posts ] 
Basic Syntax Problem 
Author Message
New pChart user
New pChart user

Joined: Tue Oct 01, 2013 12:42 pm
Posts: 2
Post Basic Syntax Problem
Hi I am running apache/mysql/php on a Windows 7 environment. I installed pChart, ran the script to test for the gd2 library (simple .ini edit as I have the ext folder) and it was successful. However I am now trying to generate a simple graph by following the code on the basic syntax page, http://wiki.pchart.net/doc.basic.syntax.html. All I am getting is the broken icon image, the one that shows if your image path reference is wrong. Just in case I left out something here is the code I used, right off the page.
Code:
<?php
/* Include all the classes */

include("pChart/class/pDraw.class.php");

include("pChart/class/pImage.class.php");

include("pChart/class/pData.class.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Pchart</title>
</head>
<?php
/* Create your dataset object */
$myData = new pData();

/* Add data in your dataset */
$myData->addPoints(array(VOID,3,4,3,5));

/* Create a pChart object and associate your dataset */
$myPicture = new pImage(700,230,$myData);


/* Define the boundaries of the graph area */
$myPicture->setGraphArea(60,40,670,190);

/* Choose a nice font */
$myPicture->setFontProperties(array("FontName"=>"pChart/fonts/Forgotte.ttf","FontSize"=>11));

/* Draw the scale, keep everything automatic */
$myPicture->drawScale();

/* Draw the scale, keep everything automatic */
$myPicture->drawSplineChart();

/* Build the PNG file and send it to the web browser */
$myPicture->Stroke();

?>
<body>
</body>
</html>

When I try the other examples that use the
Code:
Render("imagename.png")


The image file appears in the root folder but same problem, nothing shows. Just a blank page.
HELP!


Tue Oct 01, 2013 12:50 pm
Profile
New pChart user
New pChart user

Joined: Tue Oct 01, 2013 12:42 pm
Posts: 2
Post Re: Basic Syntax Problem
I have downloaded some examples done by a J Armando Jeronymo from sitePoint. The examples work just fine and things are rendering great. So it's now to dig into those examples to figure out why mine was not working. The examples can be found here https://github.com/phpmasterdotcom/ChartingWithPChart.


Wed Oct 02, 2013 1:34 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 5 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