TChart axis labels cut off

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Collectorz
Newbie
Newbie
Posts: 2
Joined: Thu Aug 04, 2011 12:00 am

TChart axis labels cut off

Post by Collectorz » Thu Aug 04, 2011 1:49 pm

Hi,

We're using a TChart in our cataloguing programs to display statistics about a user's collection. We have a weird situation that the labels for the bottom axis in a bar chart are sometimes cut off. It's not exactly clear in which conditions this happens, but it looks like a bug in the component, since all we do is add the numbers and labels.
Here's a screen shot of what it looks like. The TChart component is aligned to client:

Image

The labels on the bottom axis are in a 90 degree angle. The rest of the axis settings are pretty much default.
Is there a setting I'm missing? Or could this be a bug in the component. It's pretty hard to show you in a sample project. It may be related to how high the bars are and the string length of the labels.

Thanks,

Ronald
Collectorz.com

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

Re: TChart axis labels cut off

Post by Yeray » Thu Aug 04, 2011 3:13 pm

Hi Ronald,

If you are using a custom horizontal axis you'll have to add some extra bottom margin manually. You could use the axis MaxLabelsWidth and use this value (with some extra pixels for the ticks length) as Bottom Margin:

Code: Select all

    Chart1.MarginUnits:=muPixels;
    Chart1.MarginBottom:=Chart1.CustomAxes[0].MaxLabelsWidth + 10;
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

Collectorz
Newbie
Newbie
Posts: 2
Joined: Thu Aug 04, 2011 12:00 am

Re: TChart axis labels cut off

Post by Collectorz » Mon Aug 08, 2011 10:15 am

Thanks Yeray! That worked like a charm.

Post Reply