Board index » delphi » Teechart - draw one horizontal line with a constant

Teechart - draw one horizontal line with a constant

Hello !
How to draw one horizontal line with a constant ?
This horizontal line is included in a another serie.
I am waiting for your answer.

Friendly

 

Re:Teechart - draw one horizontal line with a constant


If you want a horizontal line you need to setup another line series and load
your constant into it....See small example.

  for I := 0 to SampSize do
      Series2.Add(YourValue,'',clTeeColor);

I have been requesting a series where you can specifiy a constant once to
draw straight lines (I use it for Spec limits...)

Jeff Clarke
74547.3...@compuserve.com

Quote
Ngu chan tung wrote in message <7oe9vo$t...@forums.borland.com>...
>Hello !
>How to draw one horizontal line with a constant ?
>This horizontal line is included in a another serie.
>I am waiting for your answer.

>Friendly

Re:Teechart - draw one horizontal line with a constant


Hi.

Perhaps you can try using Chart OnAfterDraw event to put additional line on
the chart:

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var tmpY:LongInt;
begin
     tmpY:=TChart(Sender).Series[0].GetVertAxis.CalcPosValue(20.5);
     with TChart(Sender) do
     begin
      Canvas.Pen.Color:=clGreen;
      Canvas.Pen.Width:=2;
      Canvas.MoveTo(ChartRect.Left,tmpY);
      Canvas.LineTo(ChartRect.Right,tmpY);
     end;
end;

In the example above a line will be drawn from left edge to right edge of
chart at YValue=20.5 I used CalcPosValue method to get a "screen coordinate
for horizontal line (in pixels!).
--
Regards,

Marjan Slatinek
MSlati...@teemach.com

----------------------------------------------------------------------------
----

Ngu chan tung <c...@trilogic.be> wrote in message
news:7oe9vo$t714@forums.borland.com...

Quote
> Hello !
> How to draw one horizontal line with a constant ?
> This horizontal line is included in a another serie.
> I am waiting for your answer.

> Friendly

Other Threads