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.
CircularGauge Color bug (Java Android)
-
- Newbie
- Posts: 15
- Joined: Wed Oct 30, 2013 12:00 am
CircularGauge Color bug (Java Android)
- Attachments
-
- Android Circular Gauge Bug.zip
- Source
- (1.15 KiB) Downloaded 1325 times
-
- Newbie
- Posts: 15
- Joined: Wed Oct 30, 2013 12:00 am
Re: CircularGauge Color bug (Java Android)
Here is a screenshot.
- Attachments
-
- Gauge Bug.png (139.98 KiB) Viewed 19561 times
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: CircularGauge Color bug (Java Android)
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.
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.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: CircularGauge Color bug (Java Android)
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.
Regards,
Marc Meumann
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);
Marc Meumann
Steema Support
-
- Newbie
- Posts: 15
- Joined: Wed Oct 30, 2013 12:00 am
Re: CircularGauge Color bug (Java Android)
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)
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)
- Attachments
-
- Gauge Bug2.png (128.57 KiB) Viewed 19505 times
Re: CircularGauge Color bug (Java Android)
Hello Frank,
You can get quite a close reflection of what you need with:
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
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);
Regards,
Marc
Steema Support
-
- Newbie
- Posts: 15
- Joined: Wed Oct 30, 2013 12:00 am
Re: CircularGauge Color bug (Java Android)
This worked for me
Thankyou for your help.
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);