$key) { if($key = $row['MapName']) { $maps[] = $val; } } $number[] = $row['number']; } include("class/pData.class.php"); include("class/pDraw.class.php"); include("class/pPie.class.php"); include("class/pImage.class.php"); /* Create and populate the pData object */ $MyData = new pData(); $MyData->addPoints($number,"ScoreA"); $MyData->setSerieDescription("ScoreA","Application A"); /* Define the absissa serie */ $MyData->addPoints($maps,"Labels"); $MyData->setAbscissa("Labels"); /* Create the pChart object */ $myPicture = new pImage(300,248,$MyData,TRUE); /* Write the picture title */ $myPicture->setFontProperties(array("FontName"=>"fonts/Forgotte.ttf","FontSize"=>12)); $myPicture->drawText(10,13,"Most played maps in percent",array("R"=>255,"G"=>255,"B"=>255)); /* Set the default font properties */ $myPicture->setFontProperties(array("FontName"=>"fonts/Forgotte.ttf","FontSize"=>10,"R"=>255,"G"=>255,"B"=>255)); /* Create the pPie object */ $PieChart = new pPie($myPicture,$MyData); /* Draw an AA pie chart */ $PieChart->draw2DRing(210,140,array("WriteValues"=>TRUE,"ValueR"=>255,"ValueG"=>255,"ValueB"=>255,"Border"=>TRUE)); /* Write the legend box */ $myPicture->setShadow(FALSE); $PieChart->drawPieLegend(15,40,array("Alpha"=>0)); /* Render the picture (choose the best way) */ $myPicture->autoOutput("pictures/example.draw2DRingValue.png"); } } ?>