addPoints(39,'Unix'); $DataSet->addPoints(0,'Unix'); $DataSet->addPoints(0,'Unix'); $DataSet->addPoints(0,'Unix'); $DataSet->addPoints(0,'Unix'); $DataSet->addPoints(0,'Unix'); $DataSet->addPoints(0,'Unix'); $DataSet->addPoints(90,'Windows'); $DataSet->addPoints(16,'Windows'); $DataSet->addPoints(0,'Windows'); $DataSet->addPoints(1,'Windows'); $DataSet->addPoints(9,'Windows'); $DataSet->addPoints(21,'Windows'); $DataSet->addPoints(0,'Windows'); $DataSet->addPoints(70,'Other'); $DataSet->addPoints(2,'Other'); $DataSet->addPoints(0,'Other'); $DataSet->addPoints(0,'Other'); $DataSet->addPoints(0,'Other'); $DataSet->addPoints(0,'Other'); $DataSet->addPoints(0,'Other'); $seriesColor=array('R'=>128,'G'=>0,'B'=>0,'Alpha'=>80); $DataSet->setPalette('Unix',$seriesColor); $seriesColor=array('R'=>255,'G'=>153,'B'=>0,'Alpha'=>80); $DataSet->setPalette('Windows',$seriesColor); $seriesColor=array('R'=>0,'G'=>128,'B'=>128,'Alpha'=>80); $DataSet->setPalette('Other',$seriesColor); foreach ( $networkList as $network ) { $DataSet->addPoints($network,"Labels"); // X-axis labels } $DataSet->setAxisName(0,"% of Systems"); $DataSet->setSerieDescription("Labels","Network"); $DataSet->setAbscissa("Labels"); // Normalize all data series to 100% $DataSet->normalize(100,"%"); // Create the pChart object $myPicture = new pImage(450,360,$DataSet); $myPicture->drawGradientArea(0,0,450,360,DIRECTION_HORIZONTAL,array("StartR"=>203,"StartG"=>203,"StartB"=>255,"EndR"=>163,"EndG"=>163,"EndB"=>204,"Alpha"=>40)); $myPicture->drawGradientArea(65,60,425,250,DIRECTION_VERTICAL,array("StartR"=>163,"StartG"=>163,"StartB"=>204,"EndR"=>96,"EndG"=>96,"EndB"=>128,"Alpha"=>100)); // Set default font properties $myPicture->setFontProperties(array("FontName"=>"fonts/tahoma.ttf","FontSize"=>8)); // Draw the scale and the chart $myPicture->setGraphArea(65,60,425,250); $myPicture->drawScale(array("DrawSubTicks"=>TRUE,'Mode' => SCALE_MODE_START0,"LabelRotation"=>45)); $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); $myPicture->setFontProperties(array("FontName"=>"fonts/tahoma.ttf","FontSize"=>8)); $myPicture->drawStackedBarChart(array("DisplayValues"=>TRUE,"DisplayColor"=>DISPLAY_AUTO,"Gradient"=>FALSE,"Surrounding"=>30)); $myPicture->setShadow(FALSE); // Write the picture title $myPicture->setFontProperties(array("FontName"=>"fonts/tahoma.ttf","FontSize"=>14)); $myPicture->drawText(38,38,"Distribution of Systems Across Network Groups",array("R"=>0,"G"=>0,"B"=>128)); // Write a legend box $myPicture->setFontProperties(array("FontName"=>"fonts/pf_arma_five.ttf","FontSize"=>6)); $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); // Write the chart legend */ $myPicture->drawLegend(30,320,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); // Render the chart $myPicture->Render("detailed-static.png"); //============================================================================ // YES, I know I can render directly into the web page. :) ?>