Page 1 of 1

CircularGauge Color bug (Java Android)

Posted: Mon Nov 11, 2013 9:16 am
by 16967658
Hello.
I have been using the Circular Gauge from the Teechart library.
But when the begin of the Green line starts at 30% of the graph or below the Colors of the green line start to act weird.
The beginning of the Green Line becomes the Middle Color (if you use it) or the End Color.

Also the Starting Color of the Red Line becomes the End Color.
And the End Color of the Red Line becomes the Starting Color.

See the attachment for the source code.

Re: CircularGauge Color bug (Java Android)

Posted: Mon Nov 11, 2013 9:30 am
by 16967658
Here is a screenshot.

Re: CircularGauge Color bug (Java Android)

Posted: Tue Nov 12, 2013 4:10 pm
by narcis
Hello,

This looks like a bug. Could you please add it to bugzilla? Doing so you'll be identified as the creator of the issue and therefore notified about its evolution.

Thanks in advance.

Re: CircularGauge Color bug (Java Android)

Posted: Thu Nov 14, 2013 3:51 pm
by Marc
Hello,

The effect you see is due to the limitation of the underlying gradient that the green (or red) line uses.

If you were to consider the gradient spread across a rectangle that covers the entire gauge-face and the green line arc being a cut-out across that rectangle, then you will notice that the arc will cover the same colour zones of the gradient twice if it is set to a large percentage of the entire circle. If you wish to offset that effect we recommend that you limit the gradient to two colours or set the first and middle colours as the same colour to cover a wider section of the arc.

Alternatively, knowing that the gradient is being plotted in this way you could also change the direction of it to vertical to modify the apperance.
eg.

Code: Select all

series.getGreenLine().getGradient().setDirection(GradientDirection.BACKDIAGONAL);
Regards,
Marc Meumann

Re: CircularGauge Color bug (Java Android)

Posted: Fri Nov 15, 2013 8:37 am
by 16967658
Hi marc.
I understand the limitations of the gradient.
But i really want to show the gauge with a certain gauge.
And i want the gradient to look the same no matter how long the Green Line is.

I want it to look like this (The beginning of the green line may be changed to any size and i still need the same result)

Re: CircularGauge Color bug (Java Android)

Posted: Thu Nov 21, 2013 12:41 pm
by Marc
Hello Frank,

You can get quite a close reflection of what you need with:

Code: Select all

series.getGreenLine().getGradient().setStartColor(Color.YELLOW);
series.getGreenLine().getGradient().setMiddleColor(Color.YELLOW);
series.getGreenLine().getGradient().setEndColor(Color.GREEN);

series.getGreenLine().getGradient().setDirection(GradientDirection.BACKDIAGONAL);
The only exception I could see, that the appearance changes greatly is when the GreenLine is limited to a small percentage at the high end of the Chart, for example when value range is only 20% of the total scale range. In that case you could adjust the gradient direction to VERTICAL.

Regards,
Marc

Re: CircularGauge Color bug (Java Android)

Posted: Thu Nov 21, 2013 3:13 pm
by 16967658
This worked for me

Code: Select all

                    Series.getGreenLine().getGradient().setDirection(GradientDirection.HORIZONTAL);
                    Series.getGreenLine().getGradient().setStartColor(Color.YELLOW);
                    Series.getGreenLine().getGradient().setMiddleColor(Color.GREEN);
                    Series.getGreenLine().getGradient().setEndColor(Color.GREEN);
Thankyou for your help.