Marks Tip Tool???

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
ISD
Newbie
Newbie
Posts: 5
Joined: Tue Aug 14, 2007 12:00 am

Marks Tip Tool???

Post by ISD » Thu Apr 01, 2010 4:33 pm

I would like to display the value of a series in the chart when the user hovers the mouse over that series. I saw in the features something about a Marks Tip Tool but cannot load the source for the example in Delphi 2010. I get an error: Class TMarksTipTool not found.

I am attempting this in TeeChart Standard 8 for Delphi 2010.

How can I accomplish this either by using/enabling this MarksTipTool or by code???

Thanks all,
Branden Johnson

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Marks Tip Tool???

Post by Yeray » Tue Apr 06, 2010 11:33 am

Hi Branden Johnson,

As you can see here, the Standard version doesn't give access to the Tools.
If you want to upgrade your license to the Pro version, please contact the sales department at sales at steema dot com.

On the other hand, you always can do it manually like in the following example:

Code: Select all

var line1: TLineSeries;
    MouseX, MouseY: Integer;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;

  line1:=Chart1.AddSeries(TLineSeries.Create(self)) as TLineSeries;
  line1.FillSampleValues();
  line1.Pen.Width:=2;

  Chart1.OnMouseMove:=Chart1MouseMove;
end;

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  MouseX:=X;
  MouseY:=Y;
  if line1.Clicked(X,Y)>-1 then Chart1.Draw;
end;

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var Index: Integer;
    text: string;
begin
  Index:=line1.Clicked(MouseX, MouseY);
  if Index>-1 then
  begin
    with Chart1.Canvas do
    begin
      text:=FloatToStr(line1.YValue[Index]);
      Rectangle(Rect(MouseX,MouseY,MouseX+TextWidth(text),MouseY-TextHeight(text)));
      TextOut(MouseX,MouseY-TextHeight(text),text);
    end;
  end;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply