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

Please i think im near to find this but...
http://wiki.pchart.net/forum/viewtopic.php?f=3&t=364
Page 1 of 1

Author:  juanfer [ Fri Apr 01, 2011 12:37 am ]
Post subject:  Please i think im near to find this but...

Hi, i´m a Colombian girl, i have data from mysql and i want to try pchar 3d pie. i have line 14 error, what im doing worng?
Code:
<?php
/*
     Example10 : A 3D exploded pie graph
*/
$db = mysql_connect("localhost", "root", "1Master10"); 
if ( $db == "" ) { echo " Error de conexión\r\n"; exit(); } 
 
mysql_select_db("f1db",$db);

$Requete = "SELECT `id1`,`id2`,`id3`,`id4`,`id5`,`vueltarapida` FROM `grabaresultados` ORDER BY `id1`"; 
$result  = mysql_query($Requete,$db); 
while ($row = mysql_fetch_array($result)) 

  $DataSet->AddPoint($row["id1"],"Serie1"); 
  $DataSet->AddPoint($row["id2"],"Serie2"); 
  $DataSet->AddPoint($row["id3"],"Serie3");
  $DataSet->AddPoint($row["id4"],"Serie4"); 
  $DataSet->AddPoint($row["id5"],"Serie5"); 
  $DataSet->AddPoint($row["vueltarapida"],"Serie6");   

$DataSet->AddAllSeries();
// Standard inclusions   
include("pChart/pChart/pData.class");
include("pChart/pChart/pChart.class");

// Initialise the graph
$Test = new pChart(380,200);
$Test->drawFilledRoundedRectangle(7,7,373,193,5,240,240,240);
$Test->drawRoundedRectangle(5,5,375,195,5,230,230,230);

// Draw the pie chart
$Test->setFontProperties("pChart/Fonts/tahoma.ttf",8);
$Test->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,90,110,TRUE,TRUE,50,20,5);
$Test->drawPieLegend(310,15,$DataSet->GetData(),$DataSet->GetDataDescription(),250,250,250);

$Test->Stroke("grafico.png");
?>

Author:  jean-damien [ Fri Apr 01, 2011 7:15 am ]
Post subject:  Re: Please i think im near to find this but...

Hi,

You have to start your script by the include statements :

include("pChart/pChart/pData.class.php");
include("pChart/pChart/pDraw.class.php");
include("pChart/pChart/pPie.class.php");
include("pChart/pChart/pImage.class.php");

Kind regards,
JD.

Author:  juanfer [ Fri Apr 01, 2011 2:39 pm ]
Post subject:  Re: Please i think im near to find this but...

Hi jean thanks, i´ll try it.
-----------edit----------
I´ve tryed but dont know why:

include("pChart/pChart/pData.class.php");
include("pChart/pChart/pDraw.class.php");
include("pChart/pChart/pPie.class.php");
include("pChart/pChart/pImage.class.php");

with the "pData.class.php" if in the doc files there´s not a file like that....only "pData.class".............now i have more errors than yesterday....

Author:  mice32 [ Fri Apr 01, 2011 10:39 pm ]
Post subject:  Re: Please i think im near to find this but...

juanfer wrote:
with the "pData.class.php" if in the doc files there´s not a file like that....only "pData.class".............now i have more errors than yesterday....


Maybe you're using old documentation or an old pChart release. After 2.1.0 version, p*.class files were renamed to p.*.class.php. Look.

Author:  jean-damien [ Tue Apr 05, 2011 2:37 pm ]
Post subject:  Re: Please i think im near to find this but...

Mice32 is right, you're probably using an old version of the library, I recommend you to upgrade to the latest 2.1.1 subversion.

JD.

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