Axis ZPosition property

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
David Novo
Newbie
Newbie
Posts: 71
Joined: Fri Jul 02, 2004 4:00 am
Location: Culver City
Contact:

Axis ZPosition property

Post by David Novo » Fri Jul 21, 2006 12:51 am

One of the things that we're doing with the custom axes in our application is placing them at the correct location for 0 along the other axis.

Previously we could achieve this with this code:

Code: Select all

    
    LeftAxis.PositionUnits:=muPixels;
    LeftAxis.PositionPercent:= series1.calcXPosValue(0) - tchPlotChart.chartRect.left;
Now that we're taking the depth axis into account, we'll also need to set the ZPosition property. It seems that the ZPosition can't be set using muPixels. Is that correct, or is there a way to do this?

If not, then we'll need to change to start using muPercent (for both positionPercent and ZPosition, to be consistent). We are reluctant to do that, because we don't want to be making any assumptions about how TChart converts muPixels back into the correct coordinates - ie, does does the percentage calculation change when the chart is zoomed/rotated?

My first assumption is that I can use a calculation like this:

Code: Select all

    
    LeftAxis.PositionUnits:=muPercent;
    LeftAxis.PositionPercent:= round (100 * ( (0-BottomAxis.minimum) / (BottomAxis.maximum - BottomAxis.minimum));
    LeftAxis.ZPosition:=round (100 * ( (0-DepthAxis.minimum) / (DepthAxis.maximum - DepthAxis.minimum));
(of course, the assumes all axis.mimumum values are <=0)

Would this be correct in all cases? Are there any other factors that come into play when using the percentages?

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Jul 24, 2006 11:16 am

Hi David,
the ZPosition property. It seems that the ZPosition can't be set using muPixels. Is that correct, or is there a way to do this?
You're correct, muPixels cannot be used for ZPosition. we'll add on our wish list for further releases.
TChart converts muPixels back into the correct coordinates - ie, does does the percentage calculation change when the chart is zoomed/rotated?
This should not affect.
Would this be correct in all cases? Are there any other factors that come into play when using the percentages?
It seems a fine to me (calculate it as you've done).

Post Reply