pChart 2.x forum
http://wiki.pchart.net/forum/

Basic Syntax Problem
http://wiki.pchart.net/forum/viewtopic.php?f=3&t=39914
Page 1 of 1

Author:  johnfletchertt [ Tue Oct 01, 2013 12:50 pm ]
Post subject:  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!

Author:  johnfletchertt [ Wed Oct 02, 2013 1:34 pm ]
Post subject:  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.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/