コード例 #1
0
        private void Chart_MouseMove(object sender, MouseEventArgs e)
        {
            var chart = (sender as SfChart);

            foreach (CustomFastLineBitmapSeries series in chart.Series)
            {
                if (series.ShowTooltip && series.IsHitTestSeries())
                {
                    // Finding the nearest chart data for the mouse point.
                    series.FindNearestChartPoint(e.GetPosition(series.SeriesPanel), out x, out y, out stackY);
                    dataPointInfo       = new ChartDataPointInfo();
                    dataPointInfo.XData = x;
                    dataPointInfo.YData = y;

                    // Setting the internal mouse position for the series.
                    series.SetMousePoint(e.GetPosition(Chart.AdorningCanvas));

                    // Invoking the tooltip by passing the nearest data.
                    series.UpdateSeriesTooltip(dataPointInfo);
                }
            }
        }
コード例 #2
0
 // Updates the tooltip according to the given data point.
 public void UpdateSeriesTooltip(ChartDataPointInfo dataPoint)
 {
     updateSeriesTooltipMethodInfo?.Invoke(this, new object[] { dataPoint });
 }