<?php
// Standard inclusions
// include("../../lib/pchart/pData.php"); // for the version which uses sessions to pass variables around
// include("../../lib/pchart/pChart.php");
include("includes/lib/pchart/pData.php");
include("includes/lib/pchart/pChart.php");
// Dataset definition
$DataSet = new pData;
// $DataSet->AddPoint($_SESSION['statistics_values'],"Serie1"); // for the version which uses sessions to pass variables around
// $DataSet->AddPoint($_SESSION['statistics_labels'],"Serie2");
$DataSet->AddPoint($values,"Serie1");
$DataSet->AddPoint($labels,"Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie("Serie2");
// Initialise the graph
$Test = new pChart(340,235);
$Test->setColorPalette(0,178,31,98);
$Test->setColorPalette(1,39,132,132);
$Test->setColorPalette(2,200,200,200);
$Test->setColorPalette(3,150,150,150);
$Test->setColorPalette(4,100,100,100);
$Test->drawFilledRectangle(0,0,340,300,250,250,250);
// Draw the pie chart
$Test->setFontProperties("includes/content/graphs/graph_fonts/tahoma.ttf",9);
$Test->drawFlatPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),130,120,80,PIE_PERCENTAGE_LABEL,4);
$Test->drawPieLegend(260,20,$DataSet->GetData(),$DataSet->GetDataDescription(),240,240,240);
$Test->Render('includes/content/graphs/temp.png');
?> |