Drawing lines on a Point3D series

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Normand Peladeau
Newbie
Newbie
Posts: 30
Joined: Tue Dec 28, 2004 5:00 am
Contact:

Drawing lines on a Point3D series

Post by Normand Peladeau » Tue Jan 15, 2008 1:02 am

I am drawing lines between selected points of a 2D using standard Canvas operations (MoveTo, LineTo), CalcXPosValue and CalcYPosValue. I am doing this using the BeforeDrawSeries event. The result is exactly what I expect and look like this:

http://www.simstat.com/Network.png

Now I would like to do something else with a 3D version of this, but I don't find any method to transform an X-Y-Z coordinates into a X and Y coordinates for the canvas. Is there such a method?

If not, what would be the atlternate ways to achieve this.

Those lines should ideally be of different pen width (to reflect the strength of the relationship) and there may be several lines going from one point to several others.

Any suggestion!

Normand

P.S. I did think about creating another Point3DSeries for drawing lines only (no data point), but it could require a huge amount of data point when representing all links between 200 or 500 items.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jan 15, 2008 9:43 am

Hi Normand,

What about using MoveTo3D and LineTo3D methods with X,Y and Z coordinates? Something like this:

Code: Select all

  Chart1.Canvas.Pen.Width:=3;
  Chart1.Canvas.MoveTo3D(X0,Y0,Z0);
  Chart1.Canvas.LineTo3D(X1,Y1,Z1);
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Normand Peladeau
Newbie
Newbie
Posts: 30
Joined: Tue Dec 28, 2004 5:00 am
Contact:

CalcZPosValue

Post by Normand Peladeau » Tue Jan 22, 2008 12:47 pm

Excellent, but it seems that there is no CalcZPosValue. How can I replicate this function.
narcis wrote:Hi Normand,

What about using MoveTo3D and LineTo3D methods with X,Y and Z coordinates? Something like this:

Code: Select all

  Chart1.Canvas.Pen.Width:=3;
  Chart1.Canvas.MoveTo3D(X0,Y0,Z0);
  Chart1.Canvas.LineTo3D(X1,Y1,Z1);

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jan 22, 2008 3:00 pm

Hi Normand,

What about obtaining the value from CalcZPos? This requires a series ValueIndex. You could find it using Series1.ZValues.Locate which already uses a double value and returns a ValueIndex.

Hope this helps!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Normand Peladeau
Newbie
Newbie
Posts: 30
Joined: Tue Dec 28, 2004 5:00 am
Contact:

Post by Normand Peladeau » Tue Jan 22, 2008 3:41 pm

Thanks Narcis, it works great!

Normand
narcis wrote:Hi Normand,

What about obtaining the value from CalcZPos? This requires a series ValueIndex. You could find it using Series1.ZValues.Locate which already uses a double value and returns a ValueIndex.

Hope this helps!

Post Reply