Page 1 of 2
Strange characters in axis labels.
Posted: Mon Sep 20, 2010 2:57 pm
by 9530487
See the attached image.
I selected Axis->Labels->Style->Multi-Line, and then tried setting the x axis label to have two rows.
But I get the strange character. I initially tried sending a Unicode string, then tried a UTF8 string, both have the strange character in it.
Is there any way around this?
Re: Strange characters in axis labels.
Posted: Tue Sep 21, 2010 3:17 pm
by yeray
Hi Tony,
Try with vbCr instead of vbNewLine in VB6:
Code: Select all
TChart1.AddSeries scHorizBar
TChart1.Series(0).Add 100, "top line" + vbCr + "example", clTeeColor
TChart1.Header.Text.Text = "hello" + vbCr + "world"
Re: Strange characters in axis labels.
Posted: Tue Sep 21, 2010 3:19 pm
by 9530487
I'm using MSC++. VB is not an option for me.
I've tried replacing \n with \r and \r with \n. I always get the funny space character.
Re: Strange characters in axis labels.
Posted: Thu Sep 23, 2010 10:55 am
by yeray
Hi Tony,
Only the \n seems to work fine for me here. Does it work for you?
Re: Strange characters in axis labels.
Posted: Thu Sep 23, 2010 11:37 am
by 9530487
No.
I've got
CString strModifiedTitle.Format(_T("Line 1\nLine 2"));
pTChart->Series(0).GetAsGantt().AddGantt( 0 , 0 , 0 , strModifiedTitle);
And I get "Line 1[] line 2" (so not multi line any more). The "[]" is the funny character I reported originally.
It's the Unicode build if that makes any difference.
Re: Strange characters in axis labels.
Posted: Mon Sep 27, 2010 12:08 pm
by 9530487
Bump. Any ideas/workarounds?
Re: Strange characters in axis labels.
Posted: Wed Sep 29, 2010 9:16 am
by yeray
Hi Tony,
The following seems to work fine for me in VC++ 6.0
Code: Select all
m_Chart1.AddSeries(scGantt);
CString strModifiedTitle = "Line 1\rLine 2";
m_Chart1.Series(0).GetAsGantt().AddGantt( 0 , 0 , 0 , strModifiedTitle);
- Chart1.png (2.49 KiB) Viewed 18900 times
If you still have problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.
Re: Strange characters in axis labels.
Posted: Wed Sep 29, 2010 9:20 am
by 9530487
I could upload a .TEE file. Would that help?
If I knew what the strange chars are I could remove/replace them before sending to TChart, but I cannot figure them out.
Re: Strange characters in axis labels.
Posted: Wed Sep 29, 2010 10:00 am
by yeray
Hi Tony,
I think that this problem could be very related to the exact type of project you are developing. That's why I asked for a simple project.
I'm doing the tests modifying the example at "C:\Program Files\Steema Software\TeeChart Pro v8 ActiveX Control\Examples\Visual C++\Version 6\Add data arraysVCTeeChart5.dsw" with VC++ 6.0, but this may be different than what you are doing.
A tee file could still give a different result if you generated it in an environment and I load it into another one.
Re: Strange characters in axis labels.
Posted: Wed Sep 29, 2010 10:37 am
by 9530487
The string comes from an editbox in MSVC++ 2008. The project is unicode.
If I process each string with the following function before passing to TChart, it seems to be ok. But will it be fixed in the next release (if there is ever a release)?
pString->Replace('\n','\r');
Re: Strange characters in axis labels.
Posted: Thu Sep 30, 2010 3:31 pm
by yeray
Hi Tony,
We cannot fix it until we can identify it unequivocally reproducing it in a simple application.
Here is my testing C++ application in Visual Studio 2008 with a chart, a commander and a gantt series.
www.steema.us/files/public/support/C++AXTest.zip
Doesn't it work fine for you?
Re: Strange characters in axis labels.
Posted: Thu Sep 30, 2010 4:30 pm
by 9530487
No, this does not work.
I cannot upload the attachment, I get an error "Sorry, the board attachment quota has been reached."
Re: Strange characters in axis labels.
Posted: Fri Oct 01, 2010 7:20 am
by narcis
Hi Tony,
Please post it at the
upload page then.
Re: Strange characters in axis labels.
Posted: Fri Oct 01, 2010 7:27 am
by 9530487
I've uploaded it (the file is called TChart_funny_charsLatest.jpg).
All I did was build the test project and run it.
Let me know if you need anything else.
Tony.
Re: Strange characters in axis labels.
Posted: Tue Oct 05, 2010 7:35 pm
by 9530487
Here is the file again.