Is there any way to make this work faster?Here is my sample code in vb.net. This adds a point on a chart at mouse position but it is quite slow.Private Sub Chart2_MouseMove(sender As Object, e As MouseEventArgs) Handles Chart2.MouseMoveDim coord() As Double = GetAxisValuesFromMouse(e.X, e.Y)Dim test As SeriesTry    Chart2.Series.RemoveAt(1)Catch ex As ExceptionEnd TryDim pt As New DataPointpt.XValue = coord(0)pt.YValues(0) = coord(1)test = New SeriesChart2.Series.Add(test)Chart2.Series(test.Name).ChartType = SeriesChartType.PointChart2.Series(test.Name).Points.Add(pt)End SubFunction returns the coordinates of x and y axis at mouse position.Private Function GetAxisValuesFromMouse(x As Integer, y As Integer) As Double()Dim coord(1) As DoubleDim chartArea = Chart2.ChartAreas(0)coord(0) = chartArea.AxisX.PixelPositionToValue(x)coord(1) = chartArea.AxisY.PixelPositionToValue(y)Return coordEnd FunctionResult:
Drawing a point on a chart
performance;.net;vb.net