<pre lang="cs">Point? clickPosition = null; ToolTip tooltip = new ToolTip(); private void chart1_MouseMove(object sender, MouseEventArgs e) { var pos = e.Location; clickPosition = pos; var results = chart1.HitTest(pos.X, pos.Y, false, ChartElementType.DataPoint); foreach (var result in results) { if (result.ChartElementType == ChartElementType.DataPoint) { int index = result.PointIndex; tooltip.Show("X=" + result.Series.Points[result.PointIndex].XValue + ",\nY=" + result.Series.Points[result.PointIndex].YValues[0], this.chart1, e.Location.X, e.Location.Y - 15); } else { tooltip.Hide(this.chart1); } } }</pre>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)