Page 1 of 1

Controlling what gets plotted on top in a 2D plot

Posted: Mon Jun 11, 2007 3:30 pm
by 9794096
How does TeeChart determine what series gets plotted on top when you are plotting in a 2D chart?
My users have asked for a "Bring to Front" capability to be added so they can select a single series and force it to plot on top of all of the others so it is the more visible series.

Is there an easy way to control this?

I'll take a look through the feature demo again to see if I can find it there but I didn't remember seeing that in the demo previously.

Thanks for your help again.

Aaron

Posted: Mon Jun 11, 2007 3:34 pm
by narcis
Hi Aaron,

Yes, this is possible changing series' ZOrder as told here.

Posted: Tue Jun 12, 2007 2:44 pm
by 9794096
Thanks for the quick reply.

In looking at my ZOrder properties on the series that have been added to my plot, all of them are 0.
I am not entirely sure how I should determine which one is the topmost series so that I know which one to to use in my Exchange call so that I can move the one I want up to the front.

I thought that the series with the Zorder of 0 would be the one plotted on top but when all of them have Zorder of 0, that doesn't really work.
This is a 2D plot and I have NOT previously explicitly assigned Zorder values to any of the series.

I was under the impression that I would not have more than 1 series with any particular Zorder value so if I found the one with ZOrder of 0, that would be my topmost series.
Is that idea incorrect?

Thanks again.

Posted: Tue Jun 12, 2007 3:03 pm
by narcis
Hi Aaron,

Yes, you are right, that only works when chart's view is set to 3D. In that case you can try those 2 options:

1. Set the chart to 3D view, use ZOrder and set it back to 2D view.
2. Instead of using ZOrder use the inverse of the series index, for example, the first series in the chart (series with index=0) will have the last ZOrder (series.count-1).

Posted: Tue Jun 12, 2007 3:07 pm
by narcis
Hi Aaron,

Forgot to mention that suggestion #2 should be combined with Exchange method usage.

Posted: Tue Jun 12, 2007 3:46 pm
by 9794096
So in the 2D view, exchanging the series I want to be on TOP of the drawing with the index of the last series in my collection will get my desired series drawn over the rest.

That seems to be what I am seeing in my application now.
That works fine for me.

Thanks again for your help.