View unanswered posts | View active topics It is currently Thu Mar 28, 2024 8:34 am



Reply to topic  [ 1 post ] 
Change color 
Author Message
New pChart user
New pChart user

Joined: Thu Oct 10, 2013 3:28 pm
Posts: 1
 Change color
I have use the sample : Floating 0 sample script

present on this page : http://wiki.pchart.net/doc.chart.drawbarchart.html

but i have a problem, i want have three column per point like in my upload but the problem is the first and the last column on each point have the same color how can i change that please ?

Code:
                            $MyData3 = new pData();
      $MyData3->addPoints(array(x,x,x),Score : 0");
            
      $MyData3->addPoints(array(x,x,x),Score : 1");
            
      $MyData3->addPoints(array(x,x,x),Score : 2");
      
      
      $MyData3->setAxisName(0,"Nombre de machine");
      $MyData3->addPoints(array("Hardware","OS","Oracle","WAS"),"Type");
      $MyData3->setSerieDescription("Types","Type");
      $MyData3->setAbscissa("Type");
      
      /* Create the pChart object */
      $myPicture3 = new pImage(700,230,$MyData3);
      $myPicture3->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100));
      $myPicture3->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20));
      $myPicture3->setFontProperties(array("FontName"=>"/fonts/pf_arma_five.ttf","FontSize"=>10));
      
      /* Draw the scale  */
      $myPicture3->setGraphArea(50,30,680,200);
      $myPicture3->drawScale(array("CycleBackground"=>TRUE,"DrawSubTicks"=>TRUE,"GridR"=>0,"GridG"=>0,"GridB"=>0,"GridAlpha"=>10));
      
      /* Turn on shadow computing */
      $myPicture3->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
      
      /* Draw the chart */
      $settings = array("Floating0Serie"=>"Floating 0","Draw0Line"=>TRUE,"Gradient"=>TRUE, "DisplayPos"=>LABEL_POS_INSIDE,"DisplayValues"=>TRUE,"DisplayR"=>255, "DisplayG"=>255,"DisplayB"=>255,"DisplayShadow"=>TRUE,"Surrounding"=>10);
      $myPicture3->drawBarChart($settings);
      
      /* Write the chart legend */
      $myPicture3->drawLegend(490,12,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL));
      
      /* Render the picture (choose the best way) */
      $myPicture3->Render("/documents/graph.png");


Regards,
GenesisBad


Attachments:
File comment: graph
graph.png
graph.png [ 17.75 KiB | Viewed 13650 times ]
Thu Oct 10, 2013 3:32 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: Google [Bot] and 5 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