Page 1 of 1

Fixed x to y ratio

Posted: Fri Aug 13, 2010 11:33 am
by 10547771
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

Re: Fixed x to y ratio

Posted: Fri Aug 13, 2010 4:19 pm
by yeray
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.

Re: Fixed x to y ratio

Posted: Mon Aug 23, 2010 8:29 am
by 10547771
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

Re: Fixed x to y ratio

Posted: Mon Aug 23, 2010 4:02 pm
by yeray
Hi Estechco,

You're welcome, and thanks to you for sharing your solution.

Re: Fixed x to y ratio

Posted: Mon Feb 17, 2020 7:40 am
by 16586540
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

Re: Fixed x to y ratio

Posted: Mon Feb 17, 2020 4:51 pm
by Marc
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

Re: Fixed x to y ratio

Posted: Thu Feb 20, 2020 3:56 am
by 16586540
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

Re: Fixed x to y ratio

Posted: Thu Feb 20, 2020 5:59 pm
by Marc
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

Re: Fixed x to y ratio

Posted: Thu Feb 20, 2020 7:48 pm
by 16586540
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