I Need Help in asColorLine Tool

TeeChart for ActiveX, COM and ASP
Post Reply
Jameh2020
Newbie
Newbie
Posts: 25
Joined: Fri Apr 08, 2005 4:00 am

I Need Help in asColorLine Tool

Post by Jameh2020 » Wed Jul 11, 2007 10:48 am

Hi
i add Many Lines as asColorLine Tool

The Problem is I need Now To Delete One of Them Exactly
(I do not now it's number) to Use

TChart1.Tools.Delete ColorLineNo

Can I Add a Name or Desc To Then Line To Know it ???
Thanks

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

Post by Pep » Wed Jul 11, 2007 3:24 pm

Hi,

the only way is by using the canvas techniques to draw name (text) next to each colorLine tool. It can be done with the following code :

Code: Select all

Private Sub TChart1_OnAfterDraw()
TChart1.Canvas.TextOut TChart1.Axis.Left.Position, TChart1.Axis.Left.CalcYPosValue(TChart1.Tools.Items(0).asColorLine.Value), "ColorLine0"
End Sub

Jameh2020
Newbie
Newbie
Posts: 25
Joined: Fri Apr 08, 2005 4:00 am

Post by Jameh2020 » Wed Jul 11, 2007 9:47 pm

i Think you don't understand my

i need to delete one of the asColorLine Tool , but the problem i don't now it's number.

thanks

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

Post by Pep » Thu Jul 12, 2007 8:46 am

Hi,

when you create the ColorLineTool you can save its index by using :

num = TChart1.Tools.Add(tcColorLine)
TChart1.Tools.Items(num).asColorLine.Axis = TChart1.Axis.Left
TChart1.Tools.Items(num).asColorLine.Value = X

and then remove it with :
TChart1.Tools.Delete (num)

Post Reply