runger
Regular pChart user
Joined: Wed Feb 02, 2011 4:52 pm Posts: 10
|
Alpha for a single Series in SteckedChartArea
Hi JD, The Alpha value in the following array has no influence on result (pChart 2.1) $serieSettings = array("R"=>200,"G"=>200,"B"=>200,"Alpha"=>5); How to lower visibility of a series? Reimar Code: <?php /* CAT:Misc */
/* pChart library inclusions */ include("pChart2/class/pData.class.php"); include("pChart2/class/pDraw.class.php"); include("pChart2/class/pImage.class.php");
/* Create and populate the pData object */ $MyData = new pData(); $MyData->addPoints(array(2,7,5,18,VOID,12,10,15,8,5,6,9),"Help Desk"); $MyData->addPoints(array(1,1,1,1,10,2,1,5,1,1,1,0),"Help Desk2"); $MyData->setAxisName(0,"Incidents"); $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun","Jui","Aou","Sep","Oct","Nov","Dec"),"Labels"); $MyData->setSerieDescription("Labels","Months"); $MyData->setAbscissa("Labels");
/* Create the pChart object */ $myPicture = new pImage(700,230,$MyData); /* Do some cosmetics */ $myPicture->drawLine(60,0,60,230,array("R"=>70,"G"=>70,"B"=>70)); $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); $myPicture->setFontProperties(array("FontName"=>"pChart2/fonts/Forgotte.ttf","FontSize"=>11)); $myPicture->drawText(35,115,"Recorded cases",array("R"=>255,"G"=>255,"B"=>255,"FontSize"=>20,"Angle"=>90,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
/* Prepare the chart area */ $myPicture->setGraphArea(100,30,680,190); $myPicture->setFontProperties(array("R"=>55,"G"=>55,"B"=>55,"FontName"=>"pChart2/fonts/verdana.ttf","FontSize"=>10)); $myPicture->drawScale(array("AxisR"=>55,"AxisG"=>55,"AxisB"=>55,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE));
/* Write two thresholds over the chart */ /* Draw the chart */ $serieSettings = array("R"=>200,"G"=>200,"B"=>200,"Alpha"=>5); // Alpha doesn't seem to have any influence here $MyData->setPalette("Help Desk",$serieSettings);
//$myPicture->drawStackedAreaChart(array("ForceTransparency"=>50)); $myPicture->drawStackedAreaChart(); $MyData->removeSerie("Help Desk"); $MyData->removeSerie("Help Desk2"); $MyData->addPoints(array(2,7,5,18,VOID,12,10,15,8,5,6,9),"Help Desk"); $MyData->addPoints(array(7,5,18,VOID,2,12,10,15,8,5,6,9),"Help Desk2"); $myPicture->drawSplineChart(); $myPicture->drawPlotChart();
/* Write the data bounds */ //$myPicture->writeBounds(); // Anzeige Min Max /* Write the chart legend */ $myPicture->drawLegend(500,215,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL));
/* Render the picture (choose the best way) */ $myPicture->autoOutput("pictures/example.drawThreshold.labels.png"); ?>
|