I've tried to use TSurfaceSeries in my application but I see it's impossible.
I have some points on (x,y,height). As I understand right TSurfaceSeries use y-coordinate as a height. Ok, I add points by AddXYZ() where I send height instead of y and vice versa. It means I write the following:
AddXYZ(x, height, z);
Right now my points have coordinates in range of -5000 till 5000. But this range can vary. If I have the only point (0,0,0) I have no problems, but even I try to add one another point (1700,1200,0) (0 is a height) the application starts to make something, it gets a lot of memory and all my system almost freezes. The only way to stop it close the application by the Task Manager.
What is wrong here? Why does it happen?
TSurfaceSeries takes a long time
-
- Newbie
- Posts: 11
- Joined: Mon Feb 07, 2005 5:00 am
- Contact:
Hi, Alexey.
Here are couple of rules for surface series:
1) When using surface series, first thing you should do is make sure your data forms a grid (to be more precise, your x and z values form a grid).
2) Next, you have to define the value ("height") i.e. y=y(x,z) for *every* point in grid. An analogue task would be to have a m*n matrix (where m=number of points in x direction, n number of points in z direction) and then define *all* matrix cells (for every row and column).
3) When populating surface series with data, additional (memory and speed related) limitations apply : the number of points in x or z direction cannot exceed 2000.
If your data doesn't conform with above requirements, you have two options:
1) Generate grid data by using linear interpolation (I think there is an example of this available in TeeChart demo)
2) Use TTriSurfaceSeries to plot y=y(x,z). This series type doesn't have above limitations as it uses the Voronoi algorithm to construct surface.
Hmm... You can't construct a surface cell from only two points. By definition you need four points to define surface cell (rectangle).but even I try to add one another point (1700,1200,0)
Here are couple of rules for surface series:
1) When using surface series, first thing you should do is make sure your data forms a grid (to be more precise, your x and z values form a grid).
2) Next, you have to define the value ("height") i.e. y=y(x,z) for *every* point in grid. An analogue task would be to have a m*n matrix (where m=number of points in x direction, n number of points in z direction) and then define *all* matrix cells (for every row and column).
3) When populating surface series with data, additional (memory and speed related) limitations apply : the number of points in x or z direction cannot exceed 2000.
If your data doesn't conform with above requirements, you have two options:
1) Generate grid data by using linear interpolation (I think there is an example of this available in TeeChart demo)
2) Use TTriSurfaceSeries to plot y=y(x,z). This series type doesn't have above limitations as it uses the Voronoi algorithm to construct surface.
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
-
- Newbie
- Posts: 11
- Joined: Mon Feb 07, 2005 5:00 am
- Contact:
Hi, Marjan.
In the help I see that I can try to set IrregularGrid property to true. With this setting the component works much faster, I see no such freezing. But I see no surface also I see hints only.
Maybe I use wrong component? What do you think, will this TTreSurfaceSeries solve my problem or not?
Thanks for the answer. I should describe my situation. Actually I've got irregular grid. It means my (x,y) points lie not on grid nodes, they can have any coordinates, not integer.Marjan wrote:
Hmm... You can't construct a surface cell from only two points. By definition you need four points to define surface cell (rectangle).
Here are couple of rules for surface series:
In the help I see that I can try to set IrregularGrid property to true. With this setting the component works much faster, I see no such freezing. But I see no surface also I see hints only.
Maybe I use wrong component? What do you think, will this TTreSurfaceSeries solve my problem or not?