ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  ClickHotSpot event don't work on VB6
Posted by Norm on Mar-28-2018 18:23
Hello.

On my Real Time graphic, on VB6 environnement,  I noticed that a ClickHotSpot event work only when I click axaclty on graphic line... .... same thing for DblClickHotSpot too !

How enable these events to work anywhere (full height) on a graphic ?

Thanks

  Re: ClickHotSpot event don't work on VB6
Posted by Norm on Mar-28-2018 20:15
Hi,

Forget to say that I tried :

Call layer.setImageMapWidth(1000) !

But precision about  a time when event click is not satisfying !

Private Sub Charte_ClickHotSpot(hotSpot As Collection, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Dou As Double, Da As Date
  Dou = hotSpot.Item(2)
  Da = cd.NTime(Dou)
  Debug.Print Da
End Sub



Three questions:

1 - Does exist another method maybe similar as: layer.setImageMapHeight(1000) ?
2 - Is it possible to get timeStamps value while Charte_Click event (instead ClickHotSpot) ?
3 - Is it possible to keep arrow mouse cursor when mouse is over a line (instead finger)?

Thanks

  Re: ClickHotSpot event don't work on VB6
Posted by Peter Kwan on Mar-29-2018 02:29
Hi Norm,

ChartDirector supports many chart types (pie charts, polar charts, XY charts, ...). For an XY chart, there can be many layers - scatter layers, line layers, bar layers, ... If you click an empty space, ChartDirector cannot know which hotspot it refers to, so it is normal there is no hotspot event, but there are still Click and MouseDown events.

If you are using an XY Chart, it is possible to determine the x and y coordinates of the clicked point using XYChart.getXValue and XYChart.getYValue. For example:


Private Sub ChartViewer1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

'Assume the chart is stored in ChartViewer.Chart
Dim c As XYChart
Set c = ChartViewer1.Chart

'Print out the x value at the clicked position in the debugger
Dim xValue As Double
xValue = c.getXValue(ScaleX(X, Me.ScaleMode, vbPixels))
Debug.Print xValue

'If the x-coordinate is a date/time, you can use cd.NTime to convert the xValue to VB Date

End Sub


Apart from the XYChart.getXValue, you may also use XYChart.getNearestXValue. See:

http://www.advsofteng.com/doc/cdcom.htm#XYChart.getXValue.htm
http://www.advsofteng.com/doc/cdcom.htm#XYChart.getYValue.htm
http://www.advsofteng.com/doc/cdcom.htm#XYChart.getNearestXValue.htm

The mouse cursor will change to a hand only it is over a hotspot that has a non-empty URL parameter (the first argument to getHTMLImageMap). If you use an empty string, the cursor will not change to a hand shape. Alternative, you can use the ChartViewer.HotSpotMousePointer property to configure the hot spot cursor to be an arrow.

Hope this can help.

Regards
Peter Kwan