How to set length of axis in pixels?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
UFriedrich
Newbie
Newbie
Posts: 9
Joined: Fri Dec 03, 2004 5:00 am
Location: Germany

How to set length of axis in pixels?

Post by UFriedrich » Wed Jul 09, 2008 1:02 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Jul 09, 2008 1:15 pm

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!
Best Regards,
Narcís Calvet / 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