Page 1 of 1

New line in the header caption

Posted: Thu Mar 18, 2010 12:27 am
by 15054756
We're using TeeChart in conjunction with user selectable filters.

My boss wants to print the filters as part of the heading or a subheading so that users can easily see what filters are being applied.

Seeing that there aren't any sub-headings, I'm trying to display the filters underneath the main heading through the use of a new line; however the SetCaption method doesn't seem to accept "\n" as a new line character.

Is there some setting I need to enable to accept "\n"? Or are there better alternatives that I'm not aware of?

Thanks!

Re: New line in the header caption

Posted: Fri Mar 19, 2010 2:53 pm
by yeray
Hi n00b,

In what language are you programming?
Here in VB6, if I understand well what you want to do, you can do as follows:

Code: Select all

TChart1.Header.Text.Text = "hello" + vbNewLine + "world"

Re: New line in the header caption

Posted: Sun Mar 21, 2010 11:41 pm
by 15054756
Hi Yeray,

I'm coding this in C++. I would have thought that \n would have been the equivalent of VBs vbNewLine but it doesn't seem to work.

Code: Select all


CString sHeader = "First Line" + "\nSecond Line";
m_wndChart.GetHeader().SetCaption(sHeader);

That will come out as

First LineSecond Line

instead of:

First Line
Second Line

Re: New line in the header caption

Posted: Tue Mar 23, 2010 2:28 pm
by yeray
Hi n00b,

The following code works fine here in Microsoft Visual C++ 6:

Code: Select all

m_Chart1.GetHeader().GetText().SetText("First Line\nSecond Line");

Re: New line in the header caption

Posted: Wed Mar 24, 2010 4:44 am
by 15054756
That worked perfectly!

Thanks Yeray!