Page 1 of 1

How to set length of axis in pixels?

Posted: Wed Jul 09, 2008 1:02 pm
by 9235161
Hello,

what's the right way to set the length or height of an axis in pixels by code?

In my case I've the following situation:

The chart axis should appear in a fixed relation of length. For example when the bottom axis (X) has a length of 500px the left axis (Y) should have a ratio of 0.5 that is a length of 250px. When I change the chart width and the X-axis has now a length of 300px the Y-axis should be set to a length of 150px by code.

Thanks for your help.

Best regards

Posted: Wed Jul 09, 2008 1:15 pm
by narcis
Hi UFriedrich,

You can do something like this:

Code: Select all

  Chart1.Draw;
  Chart1.Axes.Left.PositionUnits := muPixels;
  Chart1.Axes.Left.StartPosition := 0;
  Chart1.Axes.Left.EndPosition := Chart1.Axes.Bottom.IAxisSize * 0.5;
Hope this helps!