ASE Home Page Products Download Purchase Support About ASE
ChartDirector General
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  3D Scatter Plot and Line layer
Posted by Gary Hart on Jul-20-2022 15:18
Hi All,

I am hoping that this is even possible, but can a 3D scatter plot have a line layer as well connecting each of the data points?
I have data that I am plotting that has x,y,z values and a time stamp.  The x,y,z data plots fine as a 3D scatter plot, but I would like to also use the time stamp to put a line layer in that connects each of the data points in time order.
I have seen this done with Python and Matplotlib, but I don't want to use either of those.  I am using Perl with ChartDirector and the Xojo port of ChartDirector.

Any ideas would be appreciated.

Thank you.
Gary Hart.

  Re: 3D Scatter Plot and Line layer
Posted by Peter Kwan on Jul-21-2022 01:07
Hi Gary,

After laying out the 3D scatter chart (calling BaseChart.layout), you can use ThreeDChart.getXCoor and ThreeDChart.getYCoor to obtain the pixel (x, y) coordinates given the 3D data coordinates. You can then use BaseChart.addLine to add a line segment connecting the two points.

I have attached an example in Perl for your reference.

Best Regards
Peter Kwan

  Re: 3D Scatter Plot and Line layer
Posted by Peter Kwan on Jul-21-2022 01:08
Attachments:
Hi Gary,

Here are the attachments.

Best Regards
Peter Kwan
scatter.png
test.pl
test.pl

1.40 Kb

  Re: 3D Scatter Plot and Line layer
Posted by Gary Hart on Jul-21-2022 14:08
Hi Peter,
Thank you for your reply to my query.  Thank you also for the example that shows what to do to get the line layer to work.  I have modified your example to use data from my database and in Perl it works perfectly.  Using the line layer really shows up the outliers in the data well.
The Xojo version however does not work.  It just draws a single line between 2 random points on the plot.  The points used seem to have no association with the location of the data points.  This, however is not your problem, I will email MonkeyBread Software about it and see if they can help.

Thank you for your help.

Gary Hart.