Verticval bottom labels with Margin=0 causes display trouble
Posted: 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)
* (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)