I have to have multiple sizes for various charts--is there any way to have a word wrap option for the axis titles? ( I did not see anything like this).
Thank you,
Ed Dressel
word wrap on axis titles?
-
- Advanced
- Posts: 228
- Joined: Tue Aug 28, 2007 12:00 am
- Location: Oregon, USA
Hi Ed,
I'm afraid there is not an automatic option to do that. However, you could calculate the length of the title string in pixels, compare with the axis size, and add your "end of line" manually. Here is how your method could start:
I'm afraid there is not an automatic option to do that. However, you could calculate the length of the title string in pixels, compare with the axis size, and add your "end of line" manually. Here is how your method could start:
Code: Select all
procedure TForm1.WordWrap;
begin
//Bottom Axis
Canvas.Font.Size := Chart1.Axes.Bottom.Title.Font.Size;
TitleWidth := Canvas.TextWidth(Chart1.Axes.Bottom.Title.Caption);
AxisWidth := Chart1.Axes.Bottom.IEndPos - Chart1.Axes.Bottom.IStartPos;
if (AxisWidth < TitleWidth) then
begin
//... Find a substring in the title shorter than AxisWidth and add the chars #13#10 to do the line jump
end;
//Next Axis
//...
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |