|
Odometer Charts - Visual Formatting |
Posted by Adrian Groves on Jun-01-2012 23:32 |
|
I have been using odometer charts in my application, but I find them a bit 'flat' in that there
is a single colour for each section (e.g. red / amber / green).
Please see the attached image, is there any way of reproducing this within ChartDirector ?
Im talking about the effect of a lightsource in the centre of the chart which then affects all
of the colours in each section.
In addition to this, the border of the chart fades as its drawn around the diameter, can this
effect also be reproduced ?
Many thanks,
Ade
|
Re: Odometer Charts - Visual Formatting |
Posted by Peter Kwan on Jun-02-2012 10:33 |
|
Hi Adrian,
In ChartDirector, almost anything can be gradient colored.
For your case, you may use a radial gradient color as the zone color, and use a linear gradient color as the color of the "border".
For example, in Java/C#, instead of using:
//a solid color 0x66ff66
m.addZone(0, 60, 0, 85, 0x66ff66);
you may use:
//a radial gradient from 0xffffff to 0x44cc44
m.addZone(0, 60, 0, 85, m.radialGradientColor(100, 100, 85, 85, 0xffffff, 0x44cc44));
For the "border", you may use:
//4-pixel line width
m.setLineWidth(4);
//use a linear gradient color as the border color
m.setMeterColors(m.linearGradientColor(15, 0, 185, 0, 0x000000, 0xcccccc));
I have attached an example meter image produced using the above method for your reference.
Hope this can help.
Regards
Peter Kwan
|
Re: Odometer Charts - Visual Formatting |
Posted by Adrian Groves on Jun-02-2012 16:24 |
|
As usual Peter, you make it seem so simple ... Many thanks !
Ade |
|