I'm creating a TPoint3DSeries, aPS, on the fly and putting it along with a TSurfaceSeries, aSS, on a chart as follows:
aPS := TPoint3DSeries.Create(nil);
aPS.LinePen.Visible := false;
aPS.ParentChart := aChart;
aPS.Pointer.Draw3D := true;
aPS.DepthSize := 1;
aPS.OnGetMarkText := Self.GetMarkText;
aPS.OnMouseEnter := Self.SeriesMouseEnter;
aPS.OnMouseLeave := Self.SeriesMouseLeave;
aPS.OnClickPointer := Self.SeriesClickPointer;
Both series display fine, but:
1) I only get OnMouseEnter/OnMouseLeave messages reliably when I have set both aChart.Elevation and aChart.Rotation to 360 (i.e., the chart is "edge on")
2) I cannot get my OnClickPointer handler to fire at all (I have put a breakpoint in there, but it never gets hit when I click on a series point).
Can you advise? Thanks! Jim.
TPoint3DSeries - mouse move and click problems
-
- Newbie
- Posts: 12
- Joined: Thu Oct 11, 2007 12:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jim,
This happens when Chart1.Aspect.Orthogonal:=false; and the difficulty to convert from 2D screen coordinates to 3D chart coordinates. This is a known issue and is very difficult to solve as neither GDI nor GDI+ provide methods for such conversions.
This happens when Chart1.Aspect.Orthogonal:=false; and the difficulty to convert from 2D screen coordinates to 3D chart coordinates. This is a known issue and is very difficult to solve as neither GDI nor GDI+ provide methods for such conversions.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 12
- Joined: Thu Oct 11, 2007 12:00 am
Understood, in general, but you do the geometric calculations to translate from points to screen coordinates when you plot the chart, so there must surely be a way (however slow) to do the inverse operation.narcis wrote:Hi Jim,
This happens when Chart1.Aspect.Orthogonal:=false; and the difficulty to convert from 2D screen coordinates to 3D chart coordinates. This is a known issue and is very difficult to solve as neither GDI nor GDI+ provide methods for such conversions.
-
- Newbie
- Posts: 12
- Joined: Thu Oct 11, 2007 12:00 am
Still doesn't fire
I tried bothnarcis wrote:Hi Jim,
This happens when Chart1.Aspect.Orthogonal:=false; and the difficulty to convert from 2D screen coordinates to 3D chart coordinates. This is a known issue and is very difficult to solve as neither GDI nor GDI+ provide methods for such conversions.
chtAC.Aspect.Orthogonal := true;
and
chtAC.View3DOptions.Orthogonal := true;
but I could not get OnClickPointer for my TPoint3DSeries to fire when I clicked on points on the chart.
Is there something else I need to do?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jim,
It works fine for me here dropping a TChart in a form with a TSurfaceSeries and a TPoint3DSeries and this code:
It works fine for me here dropping a TChart in a form with a TSurfaceSeries and a TPoint3DSeries and this code:
Code: Select all
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, TeePoin3, TeEngine, TeeSurfa, ExtCtrls, TeeProcs, Chart,
TeeComma;
type
TForm1 = class(TForm)
Chart1: TChart;
Series1: TSurfaceSeries;
Series2: TPoint3DSeries;
TeeCommander1: TTeeCommander;
procedure FormCreate(Sender: TObject);
procedure Series2ClickPointer(Sender: TPoint3DSeries; ValueIndex, X,
Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var x,z: Integer;
y: Double;
begin
for x:=0 to 10 do
begin
for z:=0 to 10 do
begin
y:=random;
Series1.AddXYZ(x,y,z);
Series2.AddXYZ(x,y,z);
end;
end;
end;
procedure TForm1.Series2ClickPointer(Sender: TPoint3DSeries; ValueIndex, X,
Y: Integer);
begin
Chart1.Title.Text[0]:='Point clicked: ' + IntToStr(ValueIndex);
end;
end.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 12
- Joined: Thu Oct 11, 2007 12:00 am
Following up
I did it at runtime, like this:
but a breakpoint inside SeriesClickPointer never gets called.
Code: Select all
aChart.Aspect.Orthogonal := true;
aSS := TSurfaceSeries.Create(nil);
aSS.Pen.Visible := false;
aSS.ParentChart := aChart;
aPS := TPoint3DSeries.Create(nil);
aPS.LinePen.Visible := false;
aPS.ParentChart := aChart;
aPS.Pointer.Draw3D := true;
aPS.DepthSize := 1;
aPS.OnGetMarkText := Self.GetMarkText;
aPS.OnClickPointer := Self.SeriesClickPointer;
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jim,
Could you please try with a new example project like I suggested in my previous reply?
Thanks in advance!
Could you please try with a new example project like I suggested in my previous reply?
Thanks in advance!
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |