Axes.Depth.Title.Angle
Posted: Tue Sep 15, 2020 7:13 am
In a 3D Chart, I want that Axes.Depth.Title is arranged along the axis (See the red line with an arrow in the attached figure). Although the following codes were used, it still does not work. How to solve this problem?
Code: Select all
procedure TfrmUPlot3D.TheChartBeforeDrawSeries(Sender: TObject);
var
aStart, aEnd: TPoint;
aStart2D, aEnd2D: TPoint3D;
aAngle: Double;
begin
with TheChart do
begin
aStart2D.X := Axes.Depth.PosAxis;
aStart2D.Y := ChartRect.Bottom;
aStart2D.z := Axes.Depth.IStartPos;
aStart := Canvas.Calculate3DPosition(aStart2D);
aEnd2D.X := Axes.Depth.PosAxis;
aEnd2D.Y := ChartRect.Bottom;
aEnd2D.z := Axes.Depth.IEndPos;
aEnd := Canvas.Calculate3DPosition(aEnd2D);
aAngle := ArcTan2(aEnd.Y - aStart.Y, aEnd.X - aStart.X);
Axes.Depth.Title.Angle := 360 - Round(aAngle / TeePiStep);
end;
end;