Hi Kevin,
The example you mentioned are included in the ChartDirector download:
http://www.advsofteng.com/doc/cdnet.htm#multipie.htm
Like the data in the example, the different shades in the example are hard coded as an array of colors. Of course, like the data, in your real code, you can create the array using any method you like. For example, you can interpolate a deep starting color with white to compute the various shades used in the array.
Suppose you start with a color with the red, green and blue component being (R, G, B). and you want the lightest shade to be 80% white mixes with 20% of your starting color. (You probably would not want the lightest shade to be 100% white otherwise it is invisible.) If you have N sectors, the interpolation would be like:
R(i) = (255 * 0.8 * i + R x (N - 1 - 0.8 * i) / (N - 1)
... same for green and blue .....
In the above, i = 0 to N - 1 for the colors of the N sectors. You can therefore compute the RGB components of all colors in the array.
Hope this can help.
Regards
Peter Kwan |