What happened to Nearest Tool ???

TeeChart for ActiveX, COM and ASP
Post Reply
Mike
Newbie
Newbie
Posts: 40
Joined: Wed Jan 28, 2004 5:00 am

What happened to Nearest Tool ???

Post by Mike » 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

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Tue Feb 17, 2004 3:27 pm

Hi Mike,

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

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Mike
Newbie
Newbie
Posts: 40
Joined: Wed Jan 28, 2004 5:00 am

Typelibrary problem....how to fix?

Post by Mike » Wed Feb 18, 2004 1:03 pm

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

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Wed Feb 18, 2004 4:51 pm

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 ...

%>
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Mike
Newbie
Newbie
Posts: 40
Joined: Wed Jan 28, 2004 5:00 am

METADATA missing

Post by Mike » Thu Feb 19, 2004 7:29 am

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

Post Reply