Teechart Gauge - draw line between 2 values

677 views Asked by At

I have 2 GaugeSeries (GaugeSeries1.Value and GaugrSeries2.Value). I would like draw a line between these two values (i.e connect these 2 points with a line), but I don't know how do it.

1

There are 1 answers

0
RBA On

You can use the Canvas property of TeeChart. As per this example which draws a rectangle, and can be modified to suit your needs -

How can I draw extra things over a Chart ?

You should use the Chart1.Canvas object ( see Delphi's TCanvas documentation ).

But, you should do all your drawing code at the Chart1.OnAfterDraw event for the drawings to be persistent among chart repaints and to get them also when printing.

procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
  With Chart1.ChartRect do
       Canvas.Rectangle(Left,Top,Right,Bottom);
end;