iso axes but also scaled
Re: iso axes but also scaled
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.
Re: iso axes but also scaled
Hello,
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.
http://bugs.teechart.net/show_bug.cgi?id=1344
I think this simple code could be used to check the quality of any approach:fjrohlf wrote:What I sent is not exactly correct.
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've added it to the public tracker:fjrohlf wrote:It would be nice if these adjustments could be included within TeeChart.
http://bugs.teechart.net/show_bug.cgi?id=1344
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: iso axes but also scaled
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.
Re: iso axes but also scaled
Hello,
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:
I've checked it as follows:fjrohlf wrote:Thanks but it is difficult to measure whether an angle is exactly 45 degrees.
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;
I was trying to give a way to measure in the same test project but it's not so easy.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.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: iso axes but also scaled
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?
Re: iso axes but also scaled
Hello,
I'm afraid the issue hasn't been closed. I've incremented the "Importance" flag of the ticket.
I'm afraid the issue hasn't been closed. I've incremented the "Importance" flag of the ticket.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |