View unanswered posts | View active topics It is currently Wed May 08, 2024 2:16 pm



Reply to topic  [ 2 posts ] 
Alpha for a single Series in SteckedChartArea 
Author Message
Regular pChart user
Regular pChart user

Joined: Wed Feb 02, 2011 4:52 pm
Posts: 10
Post 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");
?>


Thu Feb 03, 2011 11:52 am
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: Alpha for a single Series in SteckedChartArea
This is a bug in the drawStackedAreaChart() function.

To fix it, either force the ForceTransparency variable to NULL while calling it :
Code:
$myPicture->drawStackedAreaChart(array("ForceTransparency"=>NULL));


or edit the pDraw.class.php file and replace :

Code:
     $ForceTransparency   = isset($Format["ForceTransparency"]) ? $Format["ForceTransparency"] : 80;

by
Code:
     $ForceTransparency   = isset($Format["ForceTransparency"]) ? $Format["ForceTransparency"] : NULL;


Kind regards,
JD.


Thu Feb 03, 2011 12:07 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

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