Linear Gauge Maximum Value Indicator

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
madup
Newbie
Newbie
Posts: 28
Joined: Fri Oct 07, 2005 4:00 am

Linear Gauge Maximum Value Indicator

Post by madup » Thu Aug 14, 2008 12:23 am

Is it possible to set and/or reset the maximum value indicator ?
If so how is this done ?

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Aug 14, 2008 8:31 am

Hi,

there's not a defined property to specify the maximum value indicator (you can specify the maximum of the gauge), nor a way to reset, but it can be accomplished by using the OnAfterDraw event, checking the value indicator and comparing it with the max value you want.

madup
Newbie
Newbie
Posts: 28
Joined: Fri Oct 07, 2005 4:00 am

Post by madup » Thu Aug 14, 2008 8:57 am

Hi
Thanks for the reply.
Could you provide an example of how to accomplish this in the AfterDraw.
As I was not able to find any properties that references the Max Value Indicator.
Thanks

madup
Newbie
Newbie
Posts: 28
Joined: Fri Oct 07, 2005 4:00 am

Linear Gauge Maximum Value Indicator

Post by madup » Thu Aug 14, 2008 9:24 am

Thanks for the reply.
Could you provide an example of how to imp;ement this, as I am having trouble finding properties for the Max Value Indicator
Thabks

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Aug 14, 2008 3:24 pm

Hi,
I think I misunderstood your first question. The MaxValueIndicator pointer does not have the ability to be moved via code, setting a value, it always moves automatically to the max value position assigned to the Series, but I've found a bug into the sources of the series which makes to move it only when the value is greater than 100.

This bug will be fixed for the next maintenance releases, also a new feature request have been added on our wish list (allow to set an specific position for MaxValueIndicator manually).

A way around could be to hide the MaxValueIndicator pointer setting its visible property to false and then draw manually the pointer onto the canvas, to a desired position (value). You could use similar code to the following one :

Code: Select all

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var desiredValue : double;
begin
  desiredValue := 50;
  Chart1.Canvas.Brush.Color := clred;
  Series1.MaxValueIndicator.Draw(series1.CalcXPosValue(desiredValue),series1.CalcYPosValue(0)+3);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.MaxValueIndicator.Visible:=false;
end;

madup
Newbie
Newbie
Posts: 28
Joined: Fri Oct 07, 2005 4:00 am

Post by madup » Thu Aug 14, 2008 3:54 pm

Hi
Thanks again.
While testing I did something to move the Indicator, setting the Maximum value, but it did not seem consistent.
The suggested code will work.
On the wish list could you add a second indicator, to be used to display a normal working range

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

Post by Yeray » Mon Aug 18, 2008 10:16 am

Hi,

I've added to the "wish list" the possibility to add more indicators that the user could customize.
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