Strange characters in axis labels.

TeeChart for ActiveX, COM and ASP
TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Strange characters in axis labels.

Post by TonyVSUK » Mon Sep 20, 2010 2:57 pm

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?
Attachments
TChart_funny_chars.jpg
TChart_funny_chars.jpg (17.15 KiB) Viewed 18795 times

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Strange characters in axis labels.

Post by Yeray » Tue Sep 21, 2010 3:17 pm

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"
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Re: Strange characters in axis labels.

Post by TonyVSUK » Tue Sep 21, 2010 3:19 pm

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.

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Strange characters in axis labels.

Post by Yeray » Thu Sep 23, 2010 10:55 am

Hi Tony,

Only the \n seems to work fine for me here. Does it work for you?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Re: Strange characters in axis labels.

Post by TonyVSUK » Thu Sep 23, 2010 11:37 am

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.

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Re: Strange characters in axis labels.

Post by TonyVSUK » Mon Sep 27, 2010 12:08 pm

Bump. Any ideas/workarounds?

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Strange characters in axis labels.

Post by Yeray » Wed Sep 29, 2010 9:16 am

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
Chart1.png (2.49 KiB) Viewed 18659 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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Re: Strange characters in axis labels.

Post by TonyVSUK » Wed Sep 29, 2010 9:20 am

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.

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Strange characters in axis labels.

Post by Yeray » Wed Sep 29, 2010 10:00 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Re: Strange characters in axis labels.

Post by TonyVSUK » Wed Sep 29, 2010 10:37 am

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');

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Strange characters in axis labels.

Post by Yeray » Thu Sep 30, 2010 3:31 pm

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?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Re: Strange characters in axis labels.

Post by TonyVSUK » Thu Sep 30, 2010 4:30 pm

No, this does not work.

I cannot upload the attachment, I get an error "Sorry, the board attachment quota has been reached."

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Strange characters in axis labels.

Post by Narcís » Fri Oct 01, 2010 7:20 am

Hi Tony,

Please post it at the upload page then.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Re: Strange characters in axis labels.

Post by TonyVSUK » Fri Oct 01, 2010 7:27 am

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.

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Re: Strange characters in axis labels.

Post by TonyVSUK » Tue Oct 05, 2010 7:35 pm

Here is the file again.
Attachments
TChart_funny_charsLatest.jpg
TChart_funny_charsLatest.jpg (22.85 KiB) Viewed 18580 times

Post Reply