Page 1 of 1

What happened to Nearest Tool ???

Posted: Fri Feb 13, 2004 10:25 am
by 9080645
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

Posted: Tue Feb 17, 2004 3:27 pm
by Chris
Hi Mike,

Mmmm .. shot in the dark here ... mabe something happened to the typelibrary -- have you tried using "4" instead of "tcNearest"?

Typelibrary problem....how to fix?

Posted: Wed Feb 18, 2004 1:03 pm
by 9080645
hi Christopher,

using "4" instead of tcNearest seemed to fix the problem. THANKS!!!!

What could mess up the typelibrary? And how could I fix this problem; namely I reinstalled the whole OS to my laptop (since I needed a server edition of Win 2000) and the same problem persisted there, when I only installed the TeeChart component and copied one of my test ASP pages and tested it.

Mike

Posted: Wed Feb 18, 2004 4:51 pm
by Chris
Hi Mike --
And how could I fix this problem; namely I reinstalled the whole OS to my laptop (since I needed a server edition of Win 2000) and the same problem persisted there, when I only installed the TeeChart component and copied one of my test ASP pages and tested it.
Are you sure you have the Metadata tag at the top of your ASP pages, e.g.

Code: Select all

<!--METADATA NAME="TeeChart Pro Activex control v6" TYPE="TypeLib" 
UUID="{54294AC6-FA71-4C7F-B67C-6C6405DFFD48}"--> 
<% 

'...code ...

%>

METADATA missing

Posted: Thu Feb 19, 2004 7:29 am
by 9080645
hi Christopher,

[crying....] :oops:

Seems that the METADATA tag was missing; I've deleted it at some point, but don't remember doing that....

Anyway, thanks a million for your support. Now it runs like an angel :wink:

Mike