setting a series name

TeeChart for ActiveX, COM and ASP
Post Reply
mpaulson
Newbie
Newbie
Posts: 41
Joined: Fri Nov 15, 2002 12:00 am

setting a series name

Post by mpaulson » Wed Apr 09, 2008 2:23 pm

Hi:

When I try to set a series name as follows:

With TChart1(TChartIndex).Series(foo)
' remove previous existing points from the Series
.Clear
.Name = Blox(MyBID).ebLabel


I get a runtime error complaining that the contents of "eblabel" (a simple string) is "not a valid component name".

Isn't this the way to override the "series0, series1" names used by tchart by default? If not, how does one do this?

Thanks,

Matt

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

Post by Narcís » Wed Apr 09, 2008 2:33 pm

Hi Matt,

Yes, code below works fine for me here.

Code: Select all

        .Series(0).Name = "foo"
        .Series(1).DataSource = "foo"
Which is the exact string you have in Blox(MyBID).ebLabel?

Thanks in advance.
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

mpaulson
Newbie
Newbie
Posts: 41
Joined: Fri Nov 15, 2002 12:00 am

Post by mpaulson » Wed Apr 09, 2008 2:52 pm

Hi:

The string is: " Commodity X Amount"

The code is:

With TChart1(TChartIndex).Series(foo)
' remove previous existing points from the Series
.Clear
.Name = Blox(MyBID).ebLabel

' add new points to the Series...
For i = 0 To NumXNodes - 1
.Add XNodes(i).Value, XNodes(i).Name, clTeeColor
Next i

End With

mpaulson
Newbie
Newbie
Posts: 41
Joined: Fri Nov 15, 2002 12:00 am

Post by mpaulson » Wed Apr 09, 2008 2:54 pm

Hi:

So setting the string to "foo" works. But using the string: " Commodity X Amount" does not. I tried removing the leading space to no avail.

Is there a length limit? It's a strange error message given I'm only trying to set a string.

Thanks,

Matt

mpaulson
Newbie
Newbie
Posts: 41
Joined: Fri Nov 15, 2002 12:00 am

Post by mpaulson » Wed Apr 09, 2008 2:57 pm

Hi:

It appears that anything over 9 characters produces this strange error message: "<long name> is not a valid component name"

mpaulson
Newbie
Newbie
Posts: 41
Joined: Fri Nov 15, 2002 12:00 am

Post by mpaulson » Wed Apr 09, 2008 3:05 pm

Hi again:

Sorry, I was wrong: it's any special character including space, I've discovered that & and / are also not allowed. I guess I'll restrict it to "A-Z and a-z".

-- Matt

mpaulson
Newbie
Newbie
Posts: 41
Joined: Fri Nov 15, 2002 12:00 am

Post by mpaulson » Wed Apr 09, 2008 3:18 pm

Hi:

More information: the series names get reset also.

mpaulson
Newbie
Newbie
Posts: 41
Joined: Fri Nov 15, 2002 12:00 am

Post by mpaulson » Wed Apr 09, 2008 3:19 pm

Please ignore the last message from me -- wrong topic.

My apologies.

Post Reply