Hi,
I need to find out how to autowrap a header text which might be too long for the width of the chart? W/o setting the autowrap on, the header text line gets truncated if it's too long.
Hope I've said the issue clearly enough.
Thanks.
how to autowrap header text?
Hi,
you can calculate the width of the Text that must be added and depending on it use more that one line using :
you can calculate the width of the Text that must be added and depending on it use more that one line using :
Code: Select all
textWidth = tChart1.Canvas.TextWidth("my text")
With TChart1
.Header.Text.Remove (0)
.Header.Text.Add "My First Line"
.Header.Text.Add "My Second Line"
End With
Pep Jorge
http://support.steema.com
http://support.steema.com
how to autowrap header text?
I do the following in my VC++ code:
When I set the header text with the string above, the text goes off the chart on the left and right side. However, the value of canvas_width is greater than text_width. This doesn't make sense to me. How can I accurately compare the header string length against the chart width?
Thanks.
Code: Select all
long canvas_width = m_chart.GetCanvas().GetWidth();
long text_width = m_chart.GetCanvas().TextWidth(very_long_text_string);
m_chart.GetHeader().GetText().Add(COleVariant(very_long_text_string));
Thanks.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi jonnyg,
Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |