Hi Peter,
I am trying to make it easy to correlate my mouse over a specific Chart layer so I can draw some additional markers on top.
How can I identify which layer I am over after I get the XCoor? I have a information class that has a bunch of info that belongs to a layer index that I need to coorelate. I am struggling with the linking since I can't easily ID the Layer on mouse over.
Hopefully this makes sense.
Thanks in advance!
Mike
<MOUSE OVER EVENT>
Dim xValue as Integer = Me.theChart.getNearestXValue(X*f)
Dim xCoor as Integer = Me.theChart.getXCoor(xValue)
// LOOP THROUGH OUR LAYERS
Dim thisChartLayerCount as Integer = Me.theChart.getLayerCount -1
for i = 0 to thisChartLayerCount
// GET OUR LAYER
Dim thisLayer as CDLayerMBS = Me.theChart.getLayerByZ(i)
Dim xIndex as Integer = thisLayer.getXIndexOf(xValue)
If MOUSEOVER-LAYER = MYCLASS INDEX THEN // <-- This will allow my to actually pull the right info for the mouse over layer
Dim thisDataSet as CDDataSetMBS = thisLayer.getDataSet(0)
// GET Y-COOR
Dim yCoor as Integer = Me.theChart.getYCoor(thisDataSet.getPosition(xIndex), thisDataSet.getUseYAxis())
Me.drawMarkerPoint = New REALbasic.Point(xCoor/f, yCoor/f)
Me.drawMarker = True
Me.mouseOverXIndex = xIndex
Me.mouseOverSessionIndex = i
Me.Invalidate(False)
Return
End If |