Problem: Create CursorTool at Runtime

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
bill.tarlinton
Newbie
Newbie
Posts: 4
Joined: Mon Feb 01, 2010 12:00 am

Problem: Create CursorTool at Runtime

Post by bill.tarlinton » Thu Feb 11, 2010 10:42 pm

When I create cursorTool at runtime, the chart did not show the cursor. How could I fix this?

Here are the codes.

Code: Select all

 CursorTool = new TCursorTool(this);
   CursorTool->Snap = true;
   CursorTool->FollowMouse = true;
   CursorTool->SnapStyle = Teetools::ssVertical;
   TFastLineSeries *Series1 = new TFastLineSeries(this);
   Chart1->AddSeries(Series1);
   Series1->FillSampleValues(20);
   CursorTool ->Series = Series1;
   CursorTool->Visible = true;
If I create the cursorTool at design time, that works fine.

Regards
Lizhi

bill.tarlinton
Newbie
Newbie
Posts: 4
Joined: Mon Feb 01, 2010 12:00 am

Re: Problem: Create CursorTool at Runtime

Post by bill.tarlinton » Thu Feb 11, 2010 11:04 pm

Do not worry this. I find the solution by

Code: Select all

Chart1->Tools->Add(CursorTool);
Cheers
Lizhi

Post Reply