Wrong axis display with ISO surface / Trianulation problems

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Yeray
Site Admin
Site Admin
Posts: 8973
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Wrong axis display with ISO surface / Trianulation problems

Post by Yeray » Fri May 25, 2012 9:10 am

Hi Uli,
ulibru wrote:thanks, Brush.Style has solved the problem.
But where is it set at design time? I wonder.
You can't access the Canvas properties (Brush, Pen, Font, etc) at design time. Since we are in a "custom drawing" (drawing lines and texts directly using canvas functions), we have to set these Brush, Pen and Font properties before using the canvas Brush, Pen and Font to draw lines, shapes and texts with the VertLine3D, TextOut3D (or Rectangle, Ellipse, Cube, Polygon...) canvas functions.
ulibru wrote:A final remark: the solution to use AfterDraw is not complete. So e.g. simply inverting the axis does not call the event and the label is at a wrong position.
Change this line in OnAfterDraw event:

Code: Select all

    XPos:=IEndPos;
for:

Code: Select all

    XPos:=CalcPosValue(Maximum);
ulibru wrote:Viewing the chart in e.g. top view or front view does not show the label.
I'm not sure to see this. If you can explain it better, showing an image if necessary, I'll will be pleased to try to suggest a solution if I can think on any.
ulibru wrote:It seems better I forget it all.
:? :|
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

ulibru
Newbie
Newbie
Posts: 47
Joined: Tue Jul 21, 2009 12:00 am

Re: Wrong axis display with ISO surface / Trianulation problems

Post by ulibru » Fri May 25, 2012 9:34 am

Hello Yeray,

yes, axis inversion is working now. Thanks.

Now see 3D view with added label
Image

Now in top view
Image

As you see the label has disappeared.
In addition you can also see that the other labels are just shown half, for correct display the position needs to get negative Z% values. Which is not possible. With positive Z% values the labels move to the right and disappear in the chart.
Also the ticks are not shown as they are in the wrong direction.

Best regards
Uli

Yeray
Site Admin
Site Admin
Posts: 8973
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Wrong axis display with ISO surface / Trianulation problems

Post by Yeray » Fri May 25, 2012 10:10 am

Hi Uli,

I'm a little bit confused. In the first picture the logarithmic axis seems to be the bottom axis. However, when in the second picture the logarithmic axis seems to be the left axis. So I'm not sure about how are you exactly changing from one view to the other. Can you please arrange a simple example project we can run as-is to reproduce the problem here?

I'm not sure if this will be the solution because I'm not sure about the exact origin of the problem, but it could be related to TV52015428. If this is the problem, the workaround suggested by the customer will probably work for you. In Delphi that's adding a function to calculate if a custom label is into the chart rect, and hide it accordingly. This function should be called each time the labels positions change; in general in OnScroll and OnZoom events are enough. In your case, you may also have to call it in the same function where you change from 3D to 2D:

Code: Select all

procedure TForm1.CheckLabels;
var i: Integer;
begin
  with Chart1.Axes.Bottom do
  begin
    for i:=0 to Items.Count-1 do
      if (Items[i].Value > Maximum) or (Items[i].Value < Minimum) then
        Items[i].LabelPos:=-10;
  end;
end;

procedure TForm1.Chart1Zoom(Sender: TObject);
begin
  CheckLabels;
end;

procedure TForm1.Chart1Scroll(Sender: TObject);
begin
  CheckLabels;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

ulibru
Newbie
Newbie
Posts: 47
Joined: Tue Jul 21, 2009 12:00 am

Re: Wrong axis display with ISO surface / Trianulation problems

Post by ulibru » Fri May 25, 2012 10:57 am

Hi Yeray,

I just run

Code: Select all

  Chart1.View3DOptions.Rotation := 270;
  Chart1.View3DOptions.Elevation := 270;
  Chart1.View3DOptions.Perspective := 0;
But I notice again that with your example it works (though the label is at a different position) whereas in my program it does not. Strange. I'll upgrade my program to XE2, it is still XE.

Regards
Uli

PS: you may add above code too in your example and then you should understand what I have meant about the label position and the ticks of the bottom axis.

Yeray
Site Admin
Site Admin
Posts: 8973
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Wrong axis display with ISO surface / Trianulation problems

Post by Yeray » Mon May 28, 2012 11:14 am

Hi Uli,

I think I see what you meant. Depending on the perspective you set to the chart, the axes labels can become hidden or partially hidden, overlapped by the series and the ChartRect. I've added it to the wish list to be enhanced if possible (TV52016202).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply