How to make x and y axis the same scale

TeeChart for ActiveX, COM and ASP
Post Reply
John
Newbie
Newbie
Posts: 1
Joined: Tue Feb 01, 2011 12:00 am

How to make x and y axis the same scale

Post by John » Mon Feb 28, 2011 5:27 pm

Hi,

I'd like to plot a gear with teeth and some circle, as show in the Figure 1 below. I am using TChart ActiveX control in MFD dialog. What I got does not have the right aspect ratio, i.e. the circle looks like an ellipse.

1. I tried making the chart width and height the same, but still the scales of x axis and y axis are not exactly the same. How can I make the scale of x and y the same?
2. The legend can be put at the bottom which will make it looks better, but still the legend will affect the scale of x and y axis. Is there a way to avoid that?
3.In the case that the X range (Xmin~Xmax) and Y range (Ymin~Ymax) are not the same, for example only plot several teeth, the tooth shape will be distorted as shown in Figure 2. So how to fix it?
4. When I change the dialog size, I want the size of TChart control changed accordingly/automatically. Is there a way to do that?

Thanks
JW
Attachments
Figure1.JPG
Figure1.JPG (107.07 KiB) Viewed 4645 times
Figure2.JPG
Figure2.JPG (104.17 KiB) Viewed 4636 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: How to make x and y axis the same scale

Post by Sandra » Tue Mar 01, 2011 3:10 pm

Hello John,
1. I tried making the chart width and height the same, but still the scales of x axis and y axis are not exactly the same. How can I make the scale of x and y the same?
You can use property of Axes SetMinMax as do in below lines of code:

Code: Select all

TChart1.Axis.Bottom.SetMinMax 0, 50
TChart1.Axis.Left.SetMinMax 0, 50
2. The legend can be put
at the bottom which will make it looks better, but still the legend will affect the scale of x and y axis. Is there a way to avoid that?
Sorry but I don't understand well what do you achieve with legend. Could you please, explain exactly what do you want do with legend, step to step?
3.In the case that the X range (Xmin~Xmax) and Y range (Ymin~Ymax) are not the same, for example only plot several teeth, the tooth shape will be distorted as shown in Figure 2. So how to fix it?
I think that a good option for your is use Anti-Alaising tool. You can find an example in TeeChartActiveX Demo Project concretely All Features\Tools\Antialias Filter
4. When I change the dialog size, I want the size of TChart control changed accordingly/automatically. Is there a way to do that?
You can use OnResize event of Chart to change automatically the size of Chart

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply