Page 1 of 1

setting a series name

Posted: Wed Apr 09, 2008 2:23 pm
by 6928489
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

Posted: Wed Apr 09, 2008 2:33 pm
by narcis
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.

Posted: Wed Apr 09, 2008 2:52 pm
by 6928489
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

Posted: Wed Apr 09, 2008 2:54 pm
by 6928489
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

Posted: Wed Apr 09, 2008 2:57 pm
by 6928489
Hi:

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

Posted: Wed Apr 09, 2008 3:05 pm
by 6928489
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

Posted: Wed Apr 09, 2008 3:18 pm
by 6928489
Hi:

More information: the series names get reset also.

Posted: Wed Apr 09, 2008 3:19 pm
by 6928489
Please ignore the last message from me -- wrong topic.

My apologies.