Drawing a point on a chart
Unless I'm mistaken, the MouseMove event fires everytime the mouse coordinates change - and when you're moving the mouse across the chart, that's a couple dozens (if not hundreds) of times in a very limited amount of time (&lt;1 second!).

There are a couple things that stand out in your code:


Your indentation is off. You need to give the Tab button the lovin' it deserves!
An empty Catch block is bad. You're swallowing exceptions without ever knowing if anything has gone wrong. Don't do that!
GetAxisValuesFromMouse should be returning a Point, not an array of doubles. Returning a simple struct instead of an array can help you gain a couple cycles - my background is c# so the syntax might be a little off here:

Public Structure PointD ' named after System.Drawing.PointF which is using Float/Single.
    Public X As Double
    Public Y As Double
    Public Sub New(ByVal XValue As Double, ByVal YValue As Double)
        X = XValue
        Y = YValue
    End Sub
End Structure

Private Function GetAxisValuesFromMouse(x As Integer, y As Integer) As Double()

    return New PointD(chartArea.AxisX.PixelPositionToValue(x), _
                      chartArea.AxisY.PixelPositionToValue(y))

End Function

The chart object is abstracting a lot of plumbing, and I suspect this plumbing is where your bottleneck is. Your code removes a series, creates a new data point, adds a new series and adds the data point to the new series; the chart probably gets redrawn when you remove the series, and again when you add it, and once more when you add the point. It would be much more efficient to move the datapoint instead of recreating the series everytime the mouse moves by a pixel.


I suggest you only create the data point when you don't already have it (i.e. only once!); keep a reference to your data point, and simply change its coordinates per the mouse. If that alone doesn't do it, you'll need code that finds the data point and moves it. Since you're drawing the point on its own series, that shouldn't be too hard to achieve. The chart will only redraw itself when the coordinates of the point have changed, and when the mouse moves you'll only be fetching the mouse coordinates and assigning new values to the point's XY values. I'm sure this would be much faster.

And yeah, exceptions incur some performance hit, so if your code is swallowing exceptions that is another possible bottleneck, but if you're only moving a data point around, you shouldn't have to worry about that.