private void chartSpectrum_onMouseMove(object sender, MouseEventArgs e) { if (scanning) { ChartArea chartArea = chartSpectrum.ChartAreas[0]; try { lastMousePositionX = chartArea.AxisX.PixelPositionToValue(e.X); lastMousePositionY = chartArea.AxisY.PixelPositionToValue(e.Y); String ttString; ttString = String.Format("Wavelenght = {0} , Intensity = {1}, mouseX = {2}, mouseY = {3}", (int)lastMousePositionX, (int)lastMousePositionY, e.X, e.Y); MouseOverTT.Show(ttString, this.chartSpectrum, e.X, e.Y); lastMousePositionX = e.X; lastMousePositionY = e.Y; } catch (ArgumentException ex) { logger.display("{0}", ex.Message); } } }