|
Gauge gradient colour |
Posted by Andreas on Jul-20-2014 11:43 |
|
I just purchased CD to replace our use of Google Image Charts. Really nice product by the
way. I'm very impressed.
One thing I'm having an issue with is defining a gauge with a transition. The most basic
use case is from green to red, or from green to orange to red. I don't want set zones as in
your examples, but rather a gradient from the one colour to the other.
I've tried many many different version of radialGradientColor and radialGradientColor2, but
they don't seem to follow the gauge swoop.
See attached. This is the closest I've gotten, but it's obviously wrong.
Any help here please?
How can I transition from green to red following the gauge's meter?
Thanks,
-Andreas
|
Re: Gauge gradient colour |
Posted by Peter Kwan on Jul-21-2014 16:18 |
|
Hi Andreas,
The gradient type you mentioned is called the "Conical Gradient" (also called "Angle
Gradient" in Photoshop). It is a distinct type of gradient and cannot be created using linear
or radial gradient. It will be supported in the next version of ChartDirector. I have attached
some screen shots from the next version of ChartDirector for your reference. The next
version is scheduled to be available in Q4 2014.
In ChartDirector 5.x, one method to achieve similar effect is to create many zones, each
with a slightly different color. For a gradient with just 2 colors (eg. from red to green), with
256 zones you will get a perfect angle gradient. It is because each color only has 8 bit
resolution, so when transiting from one color to another, there cannot be more than 256
distinct colors. In practice, something like 64 steps between 2 colors are already quite
good. (Many LCD monitors manufactured a few years ago only have 6 bit colors internally
for 64 steps, even externally it accepts 8 bit signals, and many people still does not
recognize.)
I have written a short example to test to "many zones" method. As I am not sure which
programming language you are using, I just wrote the example using C# by modifying the
"Semi-Circle Meter" sample code. I have attached the code and the result for your
reference.
Regards
Peter Kwan
|
|