It seems that there is not effect setting DrawLine tool Pen properties I always get a solid, 1 point width black line.
I used the following code:
Code: Select all
//
// DrawLine1
//
Self.DrawLine1.EnableSelect := False;
//
// DrawLine1.Pen
//
Self.DrawLine1.Pen.Color := System.Drawing.Color.Brown;
Self.DrawLine1.Pen.Style := System.Drawing.Drawing2D.DashStyle.DashDot;
Self.DrawLine1.Pen.Width := 4;
Code: Select all
procedure TWinForm.TChart1_Click(sender: System.Object; e: System.EventArgs);
var
P : Point;
l : Steema.TeeChart.Tools.DrawLineItem;
begin
Debug.Write(Cursor.Position.X.ToString);
P := TChart1.PointToClient( Cursor.Position );
Debug.Write('x ' + P.X.ToString);
DrawLine1.Lines.Clear;
l := Steema.TeeChart.Tools.DrawLineItem.Create(drawLine1);;
l.StartPos.X := tChart1.Axes.Bottom.CalcPosPoint(P.X);
l.StartPos.Y := 0;
l.EndPos.X := tChart1.Axes.Bottom.CalcPosPoint(P.X);
l.EndPos.Y := TChart1.Axes.Left.Maximum;
TChart1.Invalidate;
end;
Gabor Varga