View unanswered posts | View active topics It is currently Fri Mar 29, 2024 3:47 pm



Reply to topic  [ 1 post ] 
Variable in $DataSet->AddPoint(array($var)); 
Author Message
New pChart user
New pChart user

Joined: Sun Apr 01, 2012 7:57 pm
Posts: 2
Post Variable in $DataSet->AddPoint(array($var));
I am trying to do the below but it isn't working for some reason, is it possible to use variables in the AddPoint section?

Code:
<?php
// Standard inclusions   
include("pChart/pData.class");
include("pChart/pChart.class");

// Dataset definition
$var= "1,2,3,4,5";
$DataSet = new pData;
$DataSet->AddPoint(array($var));
$DataSet->AddSerie();
$DataSet->SetSerieName("Response Time","Serie1");

// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->setGraphArea(40,30,680,200);
$Test->drawGraphArea(252,252,252);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),5,150,150,150,TRUE,0,2);
$Test->drawGrid(4,TRUE,230,230,230,255);

// Draw the line graph
$Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);

// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawLegend(65,35,$DataSet->GetDataDescription(),255,255,255);
$Test->drawTitle(60,22,"XNA8F Server Respnose",50,50,50,585);
$Test->Render("Naked.png");
?>
<img src="naked.png" />


Sun Apr 01, 2012 8:02 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

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