|
gradient color in pyramid chart |
Posted by Ramoe on Jun-11-2012 15:58 |
|
Hi,
How can I set the gradient color for each segment in the pyramidchart?
thanks in advance
Ramoe |
Re: gradient color in pyramid chart |
Posted by Peter Kwan on Jun-12-2012 01:35 |
|
Hi Ramoe,
The Pyramid chart by default already have gradient shading. You may use BaseChart.setColors2 to configure the "base color" for each segment, then use PyramidChart.setGradientShading to control the brightness variation of the "base color" to generate the gradient effect. The default is to vary the base color from 0.75 of its original brightness level to 2 times of its original brightness level. See the sample code "3D Pyramid Chart" for an example.
The gradient effect configured using PyramidChart.setGradientShading applies to all segments, so all segments would have their "base colors" vary from 0.75 to 2 times the brightness. If you would like every segment to have a different gradient, or if your gradient is not obtain by vary brightness, or the gradient direction is not the one built-into ChartDirector, the only method is:
- Use PyramidChart.setGradientShading to disable the brightness gradient effect (set the startBrightness and endBrightness to 1).
- Use BaseChart.setColors2 to set the colors as in the sample code, where the colors are created using BaseChart.linearGradientColor.
Regards
Peter Kwan |
Re: gradient color in pyramid chart |
Posted by Ramoe on Jun-13-2012 17:35 |
|
Hi Peter,
I have only be able to change the brightness of the segments, but is it also possible to let a segment have a gradient color going from red to blue?
for example something like this:
|
|