Previously we could achieve this with this code:
Code: Select all
LeftAxis.PositionUnits:=muPixels;
LeftAxis.PositionPercent:= series1.calcXPosValue(0) - tchPlotChart.chartRect.left;
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));
Would this be correct in all cases? Are there any other factors that come into play when using the percentages?