Hello,
Is it possible to achieve 3D effect on axes titles and labels as shown at the attached screenshot?
Please, note that OpenGL rendering doesn't work correctly for the case of surface series.
Best wishes,
Michael
Axes titles and labels in 3D
Re: Axes titles and labels in 3D
Hello,
The texts can be rotated manually. Here an example doing it for the Depth axis:Miket1655 wrote:Is it possible to achieve 3D effect on axes titles and labels as shown at the attached screenshot?
Code: Select all
uses TeCanvas, Math;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.Axes.Depth.Title.Hide;
Chart1.Draw;
ChartTool1Rotate(Self);
end;
procedure TForm1.ChartTool1Rotate(Sender: TObject);
var aStart, aEnd: TPoint;
aStart2D, aEnd2D: TPoint3D;
aAngle: Double;
begin
aStart2D.x:=Chart1.Axes.Bottom.IStartPos;
aStart2D.y:=Chart1.ChartRect.Bottom;
aStart2D.z:=Round(Chart1.Aspect.ZOffset);
aStart:=Chart1.Canvas.Calculate3DPosition(aStart2D);
aEnd2D.x:=Chart1.Axes.Bottom.IEndPos;
aEnd2D.y:=Chart1.ChartRect.Bottom;
aEnd2D.z:=Round(Chart1.Aspect.ZOffset);
aEnd:=Chart1.Canvas.Calculate3DPosition(aEnd2D);
aAngle:=ArcTan2(aEnd.Y-aStart.Y, aEnd.X-aStart.X);
Chart1.Axes.Bottom.Title.Angle:=360-Round(aAngle/TeePiStep);
aStart2D.x:=Chart1.Axes.Depth.PosAxis;
aStart2D.y:=Chart1.ChartRect.Bottom;
aStart2D.z:=Chart1.Axes.Depth.IStartPos;
aStart:=Chart1.Canvas.Calculate3DPosition(aStart2D);
aEnd2D.x:=Chart1.Axes.Depth.PosAxis;
aEnd2D.y:=Chart1.ChartRect.Bottom;
aEnd2D.z:=Chart1.Axes.Depth.IEndPos;
aEnd:=Chart1.Canvas.Calculate3DPosition(aEnd2D);
aAngle:=ArcTan2(aEnd.Y-aStart.Y, aEnd.X-aStart.X);
Chart1.Axes.Depth.Title.Angle:=360-Round(aAngle/TeePiStep);
end;
procedure TForm1.Chart1BeforeDrawSeries(Sender: TObject);
const off = 20;
begin
Chart1.Canvas.AssignFont(Chart1.Axes.Depth.Title.Font);
Chart1.Canvas.RotateLabel3D(Chart1.Axes.Depth.PosAxis + off,
Chart1.ChartRect.Bottom-Round(Chart1.ChartHeight*Chart1.Axes.Depth.ZPosition*0.01) + off,
(Chart1.Width3D div 2),
Chart1.Axes.Depth.Title.Caption,Chart1.Axes.Depth.Title.Angle,
Chart1.Axes.Depth.Title.TextFormat=ttfHtml);
end;
If that's a known issue, could you please add a link to where it was reported so we can review it?Miket1655 wrote:Please, note that OpenGL rendering doesn't work correctly for the case of surface series.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Axes titles and labels in 3D
Dear Yeray,
Thank you for the proposed solution, I will try to use it. Of course, it would be nice to have the discussed option "out-of-box" without necessity of an additional code!
Concerning OpenGL problems (I am using the latest official release 2018.24.180321 of TeeChart Pro): please, have a look how Tee9new.exe examples work in OpenGL and GDI modes, namely the examples "Surface Smoothing", "TriSurface Hiding". The size and viewpoint position changes very significantly between these modes, the similar situation happens with other 3D plot types, like surface plots.
Best wishes,
Michael
Thank you for the proposed solution, I will try to use it. Of course, it would be nice to have the discussed option "out-of-box" without necessity of an additional code!
Concerning OpenGL problems (I am using the latest official release 2018.24.180321 of TeeChart Pro): please, have a look how Tee9new.exe examples work in OpenGL and GDI modes, namely the examples "Surface Smoothing", "TriSurface Hiding". The size and viewpoint position changes very significantly between these modes, the similar situation happens with other 3D plot types, like surface plots.
Best wishes,
Michael
Re: Axes titles and labels in 3D
Hello Michael,
Here how the "Surface_Smooth" example looks by default using GDIPlus: Changing the Canas to OpenGL from the status bar contextual menu also changes the zoom. Is this what you mean? However, if you change the Canvas from the "Chart\3D\Render" tab, and you unselect "Orthogonal" checkbox from the "Chart\3D\Options" tab, it looks much better:Miket1655 wrote:Concerning OpenGL problems (I am using the latest official release 2018.24.180321 of TeeChart Pro): please, have a look how Tee9new.exe examples work in OpenGL and GDI modes, namely the examples "Surface Smoothing", "TriSurface Hiding". The size and viewpoint position changes very significantly between these modes, the similar situation happens with other 3D plot types, like surface plots.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Axes titles and labels in 3D
Dear Yeray,
Yes, I mean sudden and very large changes of scale and viewpoint when switching between GDI and OpenGL rendering. You can see them in the mentioned examples, and you demonstrated them as well.
In principle, any change of rendering should not change a view so dramatically, otherwise user experience will not be satisfactory. Maybe this effect can be a bit minimized with some additional code (changing some properties when the rendering engine is changed), but again it would be nice to have this implemented "out-of-box", as well as rotated labels and axes captions!
Maybe your team can consider these features as a proposal for the next upgrade?
Best regards,
Michael
Yes, I mean sudden and very large changes of scale and viewpoint when switching between GDI and OpenGL rendering. You can see them in the mentioned examples, and you demonstrated them as well.
In principle, any change of rendering should not change a view so dramatically, otherwise user experience will not be satisfactory. Maybe this effect can be a bit minimized with some additional code (changing some properties when the rendering engine is changed), but again it would be nice to have this implemented "out-of-box", as well as rotated labels and axes captions!
Maybe your team can consider these features as a proposal for the next upgrade?
Best regards,
Michael
Re: Axes titles and labels in 3D
Hello,
I'm still not sure to understand where are you exactly observing this unexpected behaviour. Do you see it when changing the rendering in the contextual menu of the bottom bar in the demo, in the editor or changing it by code?
I'm still not sure to understand where are you exactly observing this unexpected behaviour. Do you see it when changing the rendering in the contextual menu of the bottom bar in the demo, in the editor or changing it by code?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Axes titles and labels in 3D
Hello,
Thank you for the hint, I was not aware of right-click status bar menu in this Demo. Because of this I listed only examples with explicit "OpenGL" option. Using this menu I can say that most of 3D examples have this problem: the size and in most cases viewpoint are changing very significantly when I switch between OpenGL and GDI renderings.
The same happens in my project if I switch rendering in the code. In my view it is a big issue preventing me from using OpenGL rendering without additional tweaks.
Best wishes,
Michael
Thank you for the hint, I was not aware of right-click status bar menu in this Demo. Because of this I listed only examples with explicit "OpenGL" option. Using this menu I can say that most of 3D examples have this problem: the size and in most cases viewpoint are changing very significantly when I switch between OpenGL and GDI renderings.
The same happens in my project if I switch rendering in the code. In my view it is a big issue preventing me from using OpenGL rendering without additional tweaks.
Best wishes,
Michael
Re: Axes titles and labels in 3D
Hello,
Using the "SeriesType_Surface" example, by default you can see these Aspect settings: Changing to OpenGL using the contextual menu, it changes the Zoom: If, instead of using the contextual menu, you change to OpenGL through the Editor, nothing else is modified and it looks good:
Using the "SeriesType_Surface" example, by default you can see these Aspect settings: Changing to OpenGL using the contextual menu, it changes the Zoom: If, instead of using the contextual menu, you change to OpenGL through the Editor, nothing else is modified and it looks good:
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |