Fixed x to y ratio

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Estechco
Newbie
Newbie
Posts: 2
Joined: Fri Dec 14, 2007 12:00 am

Fixed x to y ratio

Post by Estechco » Fri Aug 13, 2010 11:33 am

I have a query that I hope someone can help me with.

One of my clients has commented that it is unhelpful when the ratio between the x and y axis is stretched, based around the shape of the underlying chart.

What he means is that for a simple graph where both x and y axis are meant to be, say, a fixed 0-100 scale he wants them to appear consistently the same length, regardless of how the surrounding margins, legends and other decorations are defined/positioned.

For TCircularSeries this seem to happen correctly i.e. the circle remains a circle rather than stretching into an ellipse. Is there an equivalent property for simple x/y graphs that I am failing to spot?

Cheers

DC

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

Re: Fixed x to y ratio

Post by Yeray » Fri Aug 13, 2010 4:19 pm

Hi DC,

I think you are trying to achieve something similar to the demo at All features\Welcome !\Axes\Isometric Axis. You should find a shortcut to the "Feature demo" program through the Start Menu.
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

Estechco
Newbie
Newbie
Posts: 2
Joined: Fri Dec 14, 2007 12:00 am

Re: Fixed x to y ratio

Post by Estechco » Mon Aug 23, 2010 8:29 am

That wasn't entirely what I had in mind (as it seems to expand the "internal" graph dimensions rather than alter the surrounding space), but it at least lead me to my own solution where I artificially expand the left/right or top/bottom margins to maintain an "isometric" looking graph.

Thank you for your help

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

Re: Fixed x to y ratio

Post by Yeray » Mon Aug 23, 2010 4:02 pm

Hi Estechco,

You're welcome, and thanks to you for sharing your solution.
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

Errol
Newbie
Newbie
Posts: 29
Joined: Mon Jul 08, 2019 12:00 am

Re: Fixed x to y ratio

Post by Errol » Mon Feb 17, 2020 7:40 am

Further to the query by Estechco of 23 August 2010, I am interested in the same solution. I have gone to the demo at All features\Welcome !\Axes\Isometric Axis, but there is no source code. Can you give more information as to how I can access the source code. I have Tee Chart Pro, but I cannot understand your instructions namely:
"Full source code of this demo and all the other TeeChart Pro examples can be found
inside TeeChart Pro Evaluation and Registered versions, downloadable from our web
site.
Once TeeChart Pro is installed, the path to this demo sources is stored at Windows
Registry.
Alternatively, click the Configure button to select the folder which contains this demo
sources."

Best regards

Errol

Marc
Site Admin
Site Admin
Posts: 1274
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Fixed x to y ratio

Post by Marc » Mon Feb 17, 2020 4:51 pm

Hello Errol,

The demo source may have been installed to your TeeChart installation folder if you selected 'yes' to examples. But otherwise you can find the source to that demo here:

https://github.com/Steema/TeeChart-VCL- ... ter/TeeNew

(specifically https://github.com/Steema/TeeChart-VCL- ... metric.pas)

Regards,
Marc
Steema Support

Errol
Newbie
Newbie
Posts: 29
Joined: Mon Jul 08, 2019 12:00 am

Re: Fixed x to y ratio

Post by Errol » Thu Feb 20, 2020 3:56 am

Hi Marc

Thanks for the directions to the examples. I found them anyway - I had moved them to a backup drive for some reason.

However, I have a problem. In the MakIsoAxis code snippet below, the values of ChartHeight and ChartWidth are always zero. Both Vertical and ParentChart are assigned. I have tried callng the procedure in an OnAfterDraw event but not improvement.

Code: Select all

begin

  with Vertical.ParentChart do
  if (ChartHeight>0) and (ChartWidth>0) then
  begin
I would be grateful if you can give me some advice as to what to try.

Best regards

Errol

Marc
Site Admin
Site Admin
Posts: 1274
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Fixed x to y ratio

Post by Marc » Thu Feb 20, 2020 5:59 pm

Hello Errol,

Check that your chart has had at least one proper repaint before running the method. For example, if I check this value, Series1.GetVertAxis.ParentChart.ChartHeight, in Form Create before the first paint, ChartHeight/Width return 0. If you run the code from the demo itself you may find some steps you can take to mimic it more closely to help hone-in on the cause of the problem.

Regards,
Marc
Steema Support

Errol
Newbie
Newbie
Posts: 29
Joined: Mon Jul 08, 2019 12:00 am

Re: Fixed x to y ratio

Post by Errol » Thu Feb 20, 2020 7:48 pm

Hi Marc Thanks for your suggestions. However, I cannot run the demo itself as Base in uses, and class(TBaseForm) give an error.
Regards
Errol

Post Reply