Wrong/bad ValueIndex on ClickSeries event?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
charlesw
Newbie
Newbie
Posts: 14
Joined: Sun Mar 09, 2003 5:00 am
Location: ithaca, ny

Wrong/bad ValueIndex on ClickSeries event?

Post by charlesw » Thu Dec 21, 2006 2:46 pm

On the ClickSeries event we use the ValueIndex to get the point label thus:

Code: Select all

 Dim PointLabel As String = s.Item(valueIndex).Label
Unfortunately, this valueIndex does not appear to point to the right point. Now, perhaps there is something that we have misunderstood, here, somewhere...

Ok, there is definitely something that we have misunderstood. How can I tell? It's easy! Since we've had this problem, when I'm adding these points to my series I am now trying to read back what I think should be at that index, thus:

Code: Select all

 With tch.Series(currentS)
 .Add(x, y, "X" & someNumber.toString, Series.PlotSeriesColor)
 Debug.WriteLine(" Index: " & index & ", " & .Item(index).Label)
 index += 1
This gives astonishing results. The debug statement writes back what I just entered. Great. Only, not great. This only works for the first 40 points. When I look at .item(40).label (or any label for any item over that) there isn't anything there.

Thoughts?

It is not likely to be easy to extract a simple example reproducing this and I, unfortunately, cannot share the source of the entire project with you. I can give you a user (please email me privately for this) to allow you to download our executable and then I can supply files to allow you to see the problem in action. I could also, again, off group, supply you with much of the code around this problem.

regards,
charles

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

Post by Narcís » Thu Dec 21, 2006 4:28 pm

Hi charlesw,

You should try using Labels(index) ValueList instead of Item(index).Label:

Code: Select all

 With tch.Series(currentS)
 .Add(x, y, "X" & someNumber.toString, Series.PlotSeriesColor)
 Debug.WriteLine(" Index: " & index & ", " & .Labels(index))
 index += 1 
If the problem persists please try arranging a simple example project, using random data, we can run "as-is" to reproduce the problem here.

You can post your files a news://steema.public.attachments newsgroup.

BTW: Which TeeChart version are you using?
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

charlesw
Newbie
Newbie
Posts: 14
Joined: Sun Mar 09, 2003 5:00 am
Location: ithaca, ny

Post by charlesw » Thu Dec 21, 2006 4:33 pm

Thanks Narcis. This is with .Net 1 - every version released over the past year but in particular 1.1.2531.28391.
I'll give your suggestion a shot.

regards,
charles

charlesw
Newbie
Newbie
Posts: 14
Joined: Sun Mar 09, 2003 5:00 am
Location: ithaca, ny

Post by charlesw » Thu Dec 21, 2006 4:43 pm

.labels(index) gives exactly the same answer as .item(index).label viz:
...
To plot: 57
Labels: 15, S57
Index: 15, S57
To plot: 60
Labels: 16, S60
Index: 16, S60 -> worked to here
To plot: 66 -> stopped
Labels: 17,
Index: 17,
To plot: 70
Labels: 18,
Index: 18,
To plot: 73
Labels: 19,
Index: 19,
To plot: 79
Labels: 20,
Index: 20,
...

I'll work on getting example code.

charlesw
Newbie
Newbie
Posts: 14
Joined: Sun Mar 09, 2003 5:00 am
Location: ithaca, ny

Post by charlesw » Tue Dec 26, 2006 7:20 pm

Ok, well, after more than 100 man hours of work, we discovered the solution on our own. We had to add:

Code: Select all

.Series(diamondSeries).XValues.Order = Styles.ValueListOrder.None
to our code. We have no idea why this isn't the default - why, when using our code, this gets unset (it is certainly not done so explicitly in our code).

regards,
charles

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

Post by Narcís » Tue Jan 02, 2007 8:26 am

Hi charles,

Most series styles are designed to represent sequential data, that's the reason of this property being set to ascending.
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

Post Reply