Click on TPoint3DSeries item

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Lenfors
Newbie
Newbie
Posts: 1
Joined: Tue Sep 06, 2016 12:00 am

Click on TPoint3DSeries item

Post by Lenfors » Mon Jun 19, 2017 11:41 am

Hello!

I'm presenting data in a 3-D view. I add "Items" with DataSeries.AddXYZ(...) and this works fine.

Now I want to add an "Information text" for each "Item", and when you hover over the point with the mouse I want to present the "Information text" in a TEditBox...

Can this be done? I cant find any AddXYZ(X, Y, Z, 'Text') function!? And I can't find how to set an OnEnter event on the Items.

Best regards, Mikael

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

Re: Click on TPoint3DSeries item

Post by Yeray » Tue Jun 20, 2017 7:04 am

Hello Mikael,
Lenfors wrote:I cant find any AddXYZ(X, Y, Z, 'Text') function!?
There's an AddXYZ(X, Y, Z, 'Text', Color) function:

Code: Select all

Function TCustom3DSeries.AddXYZ(Const AX,AY,AZ:TChartValue;
                                Const AXLabel:String; AColor:TColor):Integer;
Lenfors wrote:And I can't find how to set an OnEnter event on the Items.
This works fine for me here:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.OnMouseEnter:=Series1MouseEnter;
  Series1.OnMouseLeave:=Series1MouseLeave;
end;

procedure TForm1.Series1MouseEnter(Sender: TObject);
var ValueIndex: Integer;
    ZVal: Double;
begin
  ValueIndex:=Series1.Clicked(Chart1.GetCursorPos);
  if ValueIndex>-1 then
    Edit1.Text:='ValueIndex: ' + IntToStr(ValueIndex) + ', XValue: ' + FormatFloat('', Series1.XValue[ValueIndex]) +
                ', YValue: ' + FormatFloat('', Series1.YValue[ValueIndex]) + ', ZValue: ' + FormatFloat('', Series1.ZValue[ValueIndex]) +
                ', Label: ' + Series1.Labels[ValueIndex];
end;

procedure TForm1.Series1MouseLeave(Sender: TObject);
begin
  Edit1.Text:='';
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