pChart 2.x forum
http://wiki.pchart.net/forum/

Change color
http://wiki.pchart.net/forum/viewtopic.php?f=1&t=39953
Page 1 of 1

Author:  GenesisBad [ Thu Oct 10, 2013 3:32 pm ]
Post subject:  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 13657 times ]

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/