Reputation: 53
In a chart windows form the point the events for the point which lies on the axis line is not functioning . I have added a tool tip and chart mousedown/chart mouseup functions for the points. But when I change move the axis minimum value it seems to function. For other points which do not lie on the axis the tool tip functions work.
Upvotes: 1
Views: 50
Reputation: 53
With the reference of the below links I was able to make changes in the code and that worked . I segregated the cases for on the axis and the remaining other points in the chart.
Problem with Point ToolTip in Microsoft Charts
Private Sub Chart1_GetToolTipText(ByVal sender As Object, ByVal e As System.Windows.Forms.DataVisualization.Charting.ToolTipEventArgs) Handles Chart1.GetToolTipText
Select Case e.HitTestResult.ChartElementType
Case ChartElementType.Axis, ChartElementType.TickMarks
Dim result As HitTestResult = Chart1.HitTest(e.X, e.Y, ChartElementType.DataPoint)
If result.ChartElementType = ChartElementType.DataPoint Then
e.Text = result.Series.Points(result.PointIndex).XValue.ToString & " : " & result.Series.Points(result.PointIndex).YValues(0).ToString
End If
Exit Select
End Select
End Sub
Upvotes: 1