Changing the value color on linear gauge

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
mts
Newbie
Newbie
Posts: 18
Joined: Fri Apr 29, 2011 12:00 am

Changing the value color on linear gauge

Post by mts » Thu Jun 07, 2012 2:56 pm

I'm trying to change the color of the value bar on the linear gauge. Can't get it to work. I've tried:

linearGaugeSeries = new LinearGauge(chart1.getChart());
linearGaugeSeries.getValueAreaBrush().setColor(Color.RED);
linearGaugeSeries.getValueAreaBrush().setForegroundColor(Color.RED);
linearGaugeSeries.getFaceBrush().setColor(Color.RED);
linearGaugeSeries.getFaceBrush().setForegroundColor(Color.RED);

but it always stays blue like this screenshot. This is with the v2012 evaluation version.
Attachments
linear gauge color.png
linear gauge color.png (14.45 KiB) Viewed 14392 times

mts
Newbie
Newbie
Posts: 18
Joined: Fri Apr 29, 2011 12:00 am

Re: Changing the value color on linear gauge

Post by mts » Thu Jun 07, 2012 3:13 pm

Also having a probelm setting the increment on a regular Gauges series.

double dHigh = 8000;
double dLow = 0;
gaugeSeries = new Gauges(chart1.getChart());

gaugeSeries.setMinimum(dLow);
gaugeSeries.setMaximum(dHigh);

gaugeSeries.getHorizAxis().setIncrement((dHigh - dLow)/10);
gaugeSeries.getVertAxis().setIncrement((dHigh - dLow)/10);
chart1.getAxes().getLeft().setIncrement((dHigh - dLow)/10);
chart1.getAxes().getBottom().setIncrement((dHigh - dLow)/10);
Attachments
gauges no increment.png
gauges no increment.png (13.64 KiB) Viewed 14363 times

Yeray
Site Admin
Site Admin
Posts: 9534
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Changing the value color on linear gauge

Post by Yeray » Mon Jun 11, 2012 1:57 pm

Hi Mark,
mts wrote:I'm trying to change the color of the value bar on the linear gauge. Can't get it to work.
Try with:

Code: Select all

linearGaugeSeries.getHand().setColor(Color.RED);
mts wrote:Also having a probelm setting the increment on a regular Gauges series.
You are right. It seems the Gauges axis increment is forced to 10. I've fixed it for the next maintenance release so this will work fine:

Code: Select all

gaugeSeries.getVertAxis().setIncrement((dHigh - dLow)/10);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

WhebJava
Newbie
Newbie
Posts: 10
Joined: Mon Feb 15, 2010 12:00 am

Re: Changing the value color on linear gauge

Post by WhebJava » Wed May 29, 2013 9:05 pm

About mts problem, I have the same problem.

Do you have a date to release this fix?

Yeray
Site Admin
Site Admin
Posts: 9534
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Changing the value color on linear gauge

Post by Yeray » Thu May 30, 2013 2:52 pm

Hi,
WhebJava wrote:About mts problem, I have the same problem.

Do you have a date to release this fix?
I see two problems here:

One with a workaround suggested:
Yeray wrote:
mts wrote:I'm trying to change the color of the value bar on the linear gauge. Can't get it to work.
Try with:

Code: Select all

linearGaugeSeries.getHand().setColor(Color.RED);
And a second one that should be fixed with v3.2013.0517:
Yeray wrote:
mts wrote:Also having a probelm setting the increment on a regular Gauges series.
You are right. It seems the Gauges axis increment is forced to 10. I've fixed it for the next maintenance release so this will work fine:

Code: Select all

gaugeSeries.getVertAxis().setIncrement((dHigh - dLow)/10);
Which one of the problems are you reproducing? And what TeeChart version are you using?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply