Displaying values under Vertical cursor, Locate inaccurate
Posted: Mon Apr 19, 2004 11:34 am
Hello.
I am using the Cursor Tool to display series values. I use the OnCursorToolChange event to change the values displayed (added behind the series titles in the legend).
Sub axChart_OnCursorToolChange(Tool, X , Y ,XVal,YVal, Series, ValueIndex)
With axChart
.SubFooter.Visible = True
.SubFooter.Text.Clear
.SubFooter.Text.Add "Timestamp: " & cdate(XVal)
For i = 0 To .SeriesCount - 1
idx = axChart.Series(i).XValues.Locate(XVal)
.Series(i).Title = SeriesTitles(i) & " (" & FormatNumber(.Series(i).YValues.Value(idx), 3) & .Axis.Left.Title.Caption & ")"
Next
End With
End Sub
This works fine for one serie but when I add series the following series values are wrongly implied 0 for some values (axChart.Series(i).YValues.Value(idx) return 0 which is wrong). The data is time stamped data using the same timestamps and have been verified. The Cusor tool snaps to data points.
I am using ASP.Net and ActiveX version 5.0.5.
What Is the problem here? Can this be done any other way?
I am using the Cursor Tool to display series values. I use the OnCursorToolChange event to change the values displayed (added behind the series titles in the legend).
Sub axChart_OnCursorToolChange(Tool, X , Y ,XVal,YVal, Series, ValueIndex)
With axChart
.SubFooter.Visible = True
.SubFooter.Text.Clear
.SubFooter.Text.Add "Timestamp: " & cdate(XVal)
For i = 0 To .SeriesCount - 1
idx = axChart.Series(i).XValues.Locate(XVal)
.Series(i).Title = SeriesTitles(i) & " (" & FormatNumber(.Series(i).YValues.Value(idx), 3) & .Axis.Left.Title.Caption & ")"
Next
End With
End Sub
This works fine for one serie but when I add series the following series values are wrongly implied 0 for some values (axChart.Series(i).YValues.Value(idx) return 0 which is wrong). The data is time stamped data using the same timestamps and have been verified. The Cusor tool snaps to data points.
I am using ASP.Net and ActiveX version 5.0.5.
What Is the problem here? Can this be done any other way?