Verticval bottom labels with Margin=0 causes display trouble

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
h.hasenack
Newbie
Newbie
Posts: 32
Joined: Tue Jul 21, 2009 12:00 am
Location: Nijmegen, Netherlands

Verticval bottom labels with Margin=0 causes display trouble

Post by h.hasenack » Mon Nov 02, 2009 8:32 am

When using
* (quite long) vertical (90deg) axis labels,
* with all capitals in them, and
* setting panel bottom margin to 0%

It happens that the axis labels get to long and drop off of the chart panel. I have implemented a little fix for
TChartAxis.MaxLabelsWidth

At the end of the function I add

// HH: 10% extra room for vertical labels. The caculated pixel length
// is not correct when using capitals.
if (LabelsAngle<>0) then
Result:=(Result*(1000 + round(100*abs(sin(LabelsAngle*PI/180.0))))) div 1000;

to fix this. Obviously, there should be a neater way to fix this. Check attachment for test application source. (Rad studio 2007)
Attachments
TestTChart.zip
(6.58 KiB) Downloaded 237 times

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

Re: Verticval bottom labels with Margin=0 causes display trouble

Post by Yeray » Mon Nov 02, 2009 2:35 pm

Hi Hans,

I've added this to the wish list to be revised for future releases (TV52014525).
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

Post Reply