|
HotSpotMousePointer |
Posted by Dimitry on Jan-06-2010 00:12 |
|
Hi, Peter.
I am trying to make my pointer change, when it is over certain hot spot on the multichart.
In debug mode I can see that it is going to the line:
<ChartViewer1.HotSpotMousePointer = cvArrowQuestion> ,
but pointer does not change.
The code is below.
'-----------------------------------------------------
Private Sub ChartViewer1_MouseMoveHotSpot(hotSpot As Object, Button As Integer, Shift
As Integer, X As Single, Y As Single)
If ChartViewer1.MouseUsage <> cvZoomIn And ChartViewer1.MouseUsage <> cvZoomOut
Then
If Left(hotSpot.Item("title"), 7) = "StormID" Then
ChartViewer1.HotSpotMousePointer = cvArrowQuestion
Else
ChartViewer1.MousePointer = cvDefault
End If
End If
End Sub
'-----------------------------------------------------
Thanks,
Dimitry |
Re: HotSpotMousePointer |
Posted by Peter Kwan on Jan-06-2010 02:03 |
|
Hi Dimitry,
I have tried myself. It works normally in my case.
From your code, I assumed you are using VB6, and writing a zoomable chart.
To test myself, I start wituse the standard VBChartDemo.vbp sample project that comes with ChartDirector for ASP/COM/VB. Then in the "frmZoomScrollDemo2.frm" (the form for the "Zooming and Scrolling Demonstration (2)"), I added the following code:
Private Sub ChartViewer1_MouseMoveHotSpot(hotSpot As Collection, Button As Integer, Shift As Integer, X As Single, Y As Single)
ChartViewer1.HotSpotMousePointer = cvArrowQuestion
End Sub
When I run the sample code, select the "Zoom/Scroll Demo (2)", and put the mouse over a hot spot, the cursor immediately change to an arrow with a question mark.
For testing, may be you can just use the same code as mine (just put one line "ChartViewer1.HotSpotMousePointer = cvArrowQuestion" in the MouseMoveHotSpot event handler) to see if it works.
If the above still does not solve the problem, is it possible to create a sample and attach it with your message (or email to me at pkwan@advsofteng.net). I will troubleshoot it to solve the problem.
Regards
Peter Kwan |
Re: HotSpotMousePointer |
Posted by Dimitry on Jan-06-2010 03:16 |
|
Thanks Peter!
You are correct. It is working. I realized that it is not working only when mouse is over
the zones, I defined to be hot spots using area tag. (not without your help )
the code below creates a zone tool tip,
'-----------------------------------------------
For k = 1 To UBound(storms, 2)
x1 = C.getXCoor(storms(0, k))
x2 = C.getXCoor(storms(1, k))
zonetooltip = zonetooltip & "<area title='StormID:" & storms(2, k) & "; Total:" &
storms(3, k) & " in. ' shape='rect' coords='" & x1 & ",40," & x2 & ",180' />"
Next k
StatsSet.StormsImageMap = zonetooltip
'-----------------------------------------------
then it is appended to the image map.
'-----------------------------------------------
ChartViewer1.ImageMap = ChartViewer1.Chart.getHTMLImageMap("clickable", "",
"title='[{dataSetName}]: {x|mmm dd hh:nn}, {value|2}'") & StatsSet.StormsImageMap
'-----------------------------------------------
It provides the tooltip just fine when pointed over the zone area, and it also reacts to
the ChartViewer1_MouseMoveHotSpot event, but assignment of
ChartViewer1.HotSpotMousePointer = cvArrowQuestion does not do anything to the
pointer in that region. (When the pointer in the Orange colored area)
'-----------------------------------------------
Private Sub ChartViewer1_MouseMoveHotSpot(hotSpot As Object, Button As Integer,
Shift As Integer, X As Single, Y As Single)
ChartViewer1.HotSpotMousePointer = cvArrowQuestion
End Sub
'-----------------------------------------------
Thanks,
Dimitry
|
Re: HotSpotMousePointer |
Posted by Peter Kwan on Jan-06-2010 15:39 |
|
Hi Dimitry,
The hotspot you created yourself is a "silent hot spot" because it does not have the HREF attribute. So the HotSpotMousePointer does not apply. See the documention on "
ChartViewer.ImageMap" for details. (You may look for "ChartViewer.ImageMap" in the ChartDirector documentation index.)
To solve the problem, please add "href='clickable'" in the zonetooltip image map.
Hope this can help.
Regards
Peter Kwan |
Re: HotSpotMousePointer |
Posted by Dimitry on Jan-07-2010 00:33 |
|
That was simple... Thank you, Peter! |
|