Page 1 of 1

Wrong/bad ValueIndex on ClickSeries event?

Posted: Thu Dec 21, 2006 2:46 pm
by 8121878
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

Posted: Thu Dec 21, 2006 4:28 pm
by narcis
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?

Posted: Thu Dec 21, 2006 4:33 pm
by 8121878
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

Posted: Thu Dec 21, 2006 4:43 pm
by 8121878
.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.

Posted: Tue Dec 26, 2006 7:20 pm
by 8121878
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

Posted: Tue Jan 02, 2007 8:26 am
by narcis
Hi charles,

Most series styles are designed to represent sequential data, that's the reason of this property being set to ascending.