What happened to Nearest Tool ???
Posted: Fri Feb 13, 2004 10:25 am
hello,
For some reason my Nearest Tool stopped working totally and instead, the same code now provides the Cursor effect on my ASP site. Here's the code:
...
MyChart1.Tools.Add tcNearest
MyChart1.Tools.Items(0).Active = True
MyChart1.Tools.Items(0).asNearest.Series = 0
MyChart1.Tools.Items(0).asNearest.DrawLine = true
MyChart1.Tools.Items(0).asNearest.Pen.Color = vbRed
MyChart1.Tools.Items(0).asNearest.Size = 15
MyChart1.Tools.Items(0).asNearest.Style = hsDiamond
MyChart1.Tools.Add tcNearest
MyChart1.Tools.Items(1).Active = True
MyChart1.Tools.Items(1).asNearest.Series = 1
MyChart1.Tools.Items(1).asNearest.DrawLine = true
MyChart1.Tools.Items(1).asNearest.Pen.Color = vbGreen
MyChart1.Tools.Items(1).asNearest.Size = 15
MyChart1.Tools.Items(1).asNearest.Style = hsDiamond
As can be seen, I use two datasets, each of them drawing linechart (asLine).
I also use the following code to follow the mouse and show the current data point value in an textfield:
sub MyChart_OnNearestToolChange()
dim Nearest0, Nearest1
dim OldNearest0, OldNearest1
With MyChart
Nearest0 = .Tools.Items(0).asNearest.Point
Nearest1 = .Tools.Items(1).asNearest.Point
.Series(0).PointColor(Nearest) = vbCyan
document.frmValue.txtCurrent.value = "Point: " & .Series(0).XValues.Value(Nearest0) & ", Value: " & .Series(0).YValues.Value(Nearest0) & " mA"
document.frmValue.txtVoltage.value = "Point: " & .Series(1).XValues.Value(Nearest1) & ", Value: " & .Series(1).YValues.Value(Nearest1) & " V"
End With
OldNearest0 = Nearest0
OldNearest1 = Nearest1
End sub
This code worked correctly on Wednesday, but after installing Dreamweaver 2004 MX and making a minor change (=.asNearest.Size = 10) the Nearest Tool did not work anymore; instead, I see a cursor for each of the linecharts. After changing the code back to normal and even removing the Dreamweaver, the cursor still appears in the ASP site.
Am I missing something in my code or could this be some kind of fault in the component itself?
Thanks for any replies.
Mike
For some reason my Nearest Tool stopped working totally and instead, the same code now provides the Cursor effect on my ASP site. Here's the code:
...
MyChart1.Tools.Add tcNearest
MyChart1.Tools.Items(0).Active = True
MyChart1.Tools.Items(0).asNearest.Series = 0
MyChart1.Tools.Items(0).asNearest.DrawLine = true
MyChart1.Tools.Items(0).asNearest.Pen.Color = vbRed
MyChart1.Tools.Items(0).asNearest.Size = 15
MyChart1.Tools.Items(0).asNearest.Style = hsDiamond
MyChart1.Tools.Add tcNearest
MyChart1.Tools.Items(1).Active = True
MyChart1.Tools.Items(1).asNearest.Series = 1
MyChart1.Tools.Items(1).asNearest.DrawLine = true
MyChart1.Tools.Items(1).asNearest.Pen.Color = vbGreen
MyChart1.Tools.Items(1).asNearest.Size = 15
MyChart1.Tools.Items(1).asNearest.Style = hsDiamond
As can be seen, I use two datasets, each of them drawing linechart (asLine).
I also use the following code to follow the mouse and show the current data point value in an textfield:
sub MyChart_OnNearestToolChange()
dim Nearest0, Nearest1
dim OldNearest0, OldNearest1
With MyChart
Nearest0 = .Tools.Items(0).asNearest.Point
Nearest1 = .Tools.Items(1).asNearest.Point
.Series(0).PointColor(Nearest) = vbCyan
document.frmValue.txtCurrent.value = "Point: " & .Series(0).XValues.Value(Nearest0) & ", Value: " & .Series(0).YValues.Value(Nearest0) & " mA"
document.frmValue.txtVoltage.value = "Point: " & .Series(1).XValues.Value(Nearest1) & ", Value: " & .Series(1).YValues.Value(Nearest1) & " V"
End With
OldNearest0 = Nearest0
OldNearest1 = Nearest1
End sub
This code worked correctly on Wednesday, but after installing Dreamweaver 2004 MX and making a minor change (=.asNearest.Size = 10) the Nearest Tool did not work anymore; instead, I see a cursor for each of the linecharts. After changing the code back to normal and even removing the Dreamweaver, the cursor still appears in the ASP site.
Am I missing something in my code or could this be some kind of fault in the component itself?
Thanks for any replies.
Mike