Download QCChart2D CF Charting Library for the .Net Compact Framework

Transcript
Data ToolTips 345
' Precalculates the text bounding box so that the size is
' known before it is drawn
stockpanel.PreCalcTextBoundingBox(g2)
Dim boundingbox As Rectangle2D = stockpanel.GetTextBox()
' Reposition tooltip text box if top of box near top of graph window
' You can do the same thing for all four sides of the graph window
If mousepos.GetY() - boundingbox.GetHeight() < 1 Then
mousepos.SetLocation(mousepos.GetX(), mousepos.GetY() + _
boundingbox.GetHeight())
stockpanel.SetLocation(mousepos, ChartObj.DEV_POS)
End If
' Draws the tooltip text panel to the chart graphics context
stockpanel.Draw(GetToolTipGraphics())
End If
End Sub 'OnMouseDown
End Class 'CustomToolTip