iso axes but also scaled

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
fjrohlf
Newbie
Newbie
Posts: 33
Joined: Mon Sep 07, 2015 12:00 am

Re: iso axes but also scaled

Post by fjrohlf » Fri Oct 16, 2015 9:15 pm

Always one more change. What I sent is not exactly correct. If one makes the window very large and measures it one will see that it is not exactly isometric. This is because the chart margins are expressed as percentages. Thus the margins will change as one adjusts the size of the plot. Setting the margin units to maPixels fixes that problem - at least to the resolution of my screen. I guess the other thing one should add are calls to GetDeviceCaps in case one uses a device that does not have square pixels. It would be nice if these adjustments could be included within TeeChart.

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

Re: iso axes but also scaled

Post by Yeray » Mon Oct 19, 2015 12:09 pm

Hello,
fjrohlf wrote:What I sent is not exactly correct.
I think this simple code could be used to check the quality of any approach:

Code: Select all

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var x, y, tmp: Integer;
    XYScreen : Double;
begin
  XYScreen:=1.0*(GetDeviceCaps(Canvas.Handle,HORZSIZE)/Screen.Width)/
                (GetDeviceCaps(Canvas.Handle,VERTSIZE)/Screen.Height);

  tmp:=500;
  x:=Chart1.ChartRect.Left;
  y:=Chart1.ChartRect.Top;
  Chart1.Canvas.Pen.Color:=clRed;
  Chart1.Canvas.Line(x, y, x+tmp, Round(y+(tmp*XYScreen)));
  y:=Chart1.ChartRect.Bottom;
  Chart1.Canvas.Line(x, y, x+tmp, Round(y-(tmp*XYScreen)));
end;
I understand these red lines should be exactly drawn at 45º and the grid lines in a perfectly isometric chart should cross with that red lines.
fjrohlf wrote:It would be nice if these adjustments could be included within TeeChart.
I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1344
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

fjrohlf
Newbie
Newbie
Posts: 33
Joined: Mon Sep 07, 2015 12:00 am

Re: iso axes but also scaled

Post by fjrohlf » Mon Oct 19, 2015 2:03 pm

Thanks but it is difficult to measure whether an angle is exactly 45 degrees. It is easier to measure whether a vertical and a horizontal line that should be equal in length actually are equal in length. That is what I have been doing to test.

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

Re: iso axes but also scaled

Post by Yeray » Mon Oct 19, 2015 3:12 pm

Hello,
fjrohlf wrote:Thanks but it is difficult to measure whether an angle is exactly 45 degrees.
I've checked it as follows:
Take a screenshot and open the image with Paint.Net.
Draw 45º lines over the red lines by pressing "o", clicking on the start of a red line and pressing "shift" while dragging.
Actually, I get a better result when considering sqare pixels, without using GetDeviceCaps to draw the 45º red lines:

Code: Select all

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var x, y, tmp: Integer;
begin
  tmp:=500;
  x:=Chart1.ChartRect.Left;
  y:=Chart1.ChartRect.Top;
  Chart1.Canvas.Pen.Color:=clRed;
  Chart1.Canvas.Line(x, y, x+tmp, y+tmp);
  y:=Chart1.ChartRect.Bottom;
  Chart1.Canvas.Line(x, y, x+tmp, y-tmp);
end;
fjrohlf wrote:It is easier to measure whether a vertical and a horizontal line that should be equal in length actually are equal in length. That is what I have been doing to test.
I was trying to give a way to measure in the same test project but it's not so easy.
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

JimR
Newbie
Newbie
Posts: 46
Joined: Mon Oct 24, 2016 12:00 am

Re: iso axes but also scaled

Post by JimR » Thu Feb 09, 2017 9:37 am

I am just checking back and trying to use TeeChart again. I was surprised to see that this still seems to be a problem. I would have thought by now there simply would be a checkbox to produce axes with the proper aspect ratio. Why cannot one produce charts that stay square even if a user stretches the window to make a chart larger or smaller? Is there an option that I cannot find?

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

Re: iso axes but also scaled

Post by Yeray » Fri Feb 10, 2017 9:15 am

Hello,

I'm afraid the issue hasn't been closed. I've incremented the "Importance" flag of the ticket.
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

JimR
Newbie
Newbie
Posts: 46
Joined: Mon Oct 24, 2016 12:00 am

Re: iso axes but also scaled

Post by JimR » Fri Feb 10, 2017 6:42 pm

Thanks!

Post Reply