ljy0905
//设置此属性为true
chartControl1.RuntimeHitTesting = true;

private void ChartControl1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            try
            {
                ChartHitInfo hitInfo = chartControl1.CalcHitInfo(e.Location);
                if (hitInfo.SeriesPoint == null)
                {
                    toolTip.HideHint();
                    return;
                }
                //图例名
                string lengthName = ((DevExpress.XtraCharts.Native.IOwnedElement)hitInfo.SeriesPoint).Owner.ToString();
                //点的Y轴数值
                string yValue = hitInfo.SeriesPoint.Argument;
                //点的X轴数值
                string xValue = hitInfo.SeriesPoint.Values[0].ToString();
                toolTip.ShowHint(lengthName + "   " + xValue + "   " + yValue);
            }
            catch (Exception ex)
            {
                FileLogUtility.Error(ex);
            }
        }

 

分类:

技术点:

相关文章:

  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2022-01-16
  • 2022-01-08
  • 2021-12-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
  • 2021-12-25
  • 2022-12-23
  • 2021-12-25
相关资源
相似解决方案