Page 1 of 1

gauge question

Posted: Fri Apr 20, 2012 1:53 am
by 16562172
Sir:

I'm trying to work with a circular gauge component. I'm not sure how to use it. My code

Chart1.Series[0].AddX(100);

will move the pointer but only a little - always less that about 10% of the dial. If I press the Help button in the chart editor, I get an error message saying "TChart9.hlp not available". I have TChart2012.hlp but that doesn't seem to work. Is there any documentation or examples to show how to use the gauge components? Any help is appreciated.

Steve Pearce

Re: gauge question

Posted: Fri Apr 20, 2012 2:42 pm
by yeray
Hi steve,

The basic properties for the Circular Gauge are the axis Minimum and Maximum (SetMinMax), the Value, the RotationAngle, the TotalAngle and the green and red lines.
You can see an example of how you could set some of these properties in the features demo at "All Features\Welcome !\Chart styles\Gauges\Circular Gauge"

Re: gauge question

Posted: Sun Apr 22, 2012 3:46 pm
by 16562172
Yeray:

Thanks for the reply. I think I've almost solved my problem. The followng code works with a simple circular gauge:

procedure TForm1.Button1Click(Sender: TObject);
begin
Series1.Value:=10;
Sleep(500);
Series1.Value:=30;
Sleep(500);
Series1.Value:=80;
end;


With a knob or linear gauge, the gauge only displays the last value. It's as if the gauge component will only respond when the button event handler finishes. What is different about the way the different gauge components handle the code? I'd like to be able to move the gauge multiple times within one button handler for all circular gauges, not just the simple circular one. Thanks for any help.

Steve Pearce

Re: gauge question

Posted: Mon Apr 23, 2012 11:13 am
by yeray
Hi Steve,

You could force a chart repaint to update the hand:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
begin
  Series1.Value:=10;
  Chart1.Draw;

  Sleep(500);
  Series1.Value:=30;
  Chart1.Draw;

  Sleep(500);
  Series1.Value:=80;
end;

Re: gauge question

Posted: Tue Apr 24, 2012 12:02 am
by 16562172
Yeray:

Thanks - it worked.

Steve Pearce