|
DataColor |
Posted by Adrian Groves on Sep-05-2011 23:56 |
|
Hi there,
I am drawing a pie chart using the standard chartdirector colours, which can be referenced
by the constant DataColor + pie sector number. I want to show these colours with some
transparency too. How do I get the actual ARGB value for each DataColor pie sector so I
can alter it and add some transparency ?
thanks,
Ade |
Re: DataColor |
Posted by Kiran Sattikar on Sep-13-2011 19:29 |
|
Adrian Groves wrote:
Hi there,
I am drawing a pie chart using the standard chartdirector colours, which can be referenced
by the constant DataColor + pie sector number. I want to show these colours with some
transparency too. How do I get the actual ARGB value for each DataColor pie sector so I
can alter it and add some transparency ?
thanks,
Ade
Hi Ade,
1) You can use setSectorStyle(Chart.LocalGradientShading); method of piechart object.
2) You can get ARGB pie colors using any web devlopment tool like colorpicker/G-chrome/Firebug of mozilla. Use setColor method of piechart sector.
Regards,
Kiran Sattikar |
Re: DataColor |
Posted by Peter Kwan on Sep-14-2011 01:47 |
|
Hi Adrian,
Sorry for the late reply.
You can always set any sector color to semi-transparent by using Sector.setColor or BaseChart.setDataColor. You just need to use a semi-transparent color like 0x80ff3333. (The color should have 8 digits, with the first two digits representing the transparent level. A value of 80 means half transparent.)
If you would like to get the automatic colors used in ChartDirector, and convert them into semi-transparent colors, the code is like:
for ($i = 0; $i < $noOfSectors; ++$i) {
$myColor = $c->getDrawArea()->getARGBColor(DataColor + $i);
$c->setColor2(DataColor + $i, array(0x80000000 + $myColor));
}
Hope this can help.
Regards
Peter Kwan |
|