DevExpress.XtraCharts曲线上的点所对应的坐标值

时间:2021-10-13 17:14:50
private void chartControl_ObjectSelected(object sender, HotTrackEventArgs e)
{
e.Cancel = false;
XYDiagram xyDiagram = null;
if (e.Object is XYDiagram)
{
xyDiagram = (XYDiagram)e.Object;
}
else if (e.Object is SeriesBase)
{
xyDiagram = (XYDiagram)(e.HitInfo.Diagram);
}
if (xyDiagram != null)
{
DiagramCoordinates coord = xyDiagram.PointToDiagram(e.HitInfo.HitPoint);
DateTime pTime = coord.DateTimeArgument;//时间点
/*..其他针对该时间点的处理..*/
}
}