【发布时间】:2015-10-21 04:20:28
【问题描述】:
我想知道如何(特别是)获得我使用 OxyPlot 绘制的散点图的 x 坐标。
//user clicks on graph line data...
//x-coordinate gets assigned to variable
int x = ...
我正在使用 winforms。
编辑:
private void plotView_Click(object sender, EventArgs e){
plotView.ActualModel.Series[0].MouseDown += (s, e0) =>
{
if (e0.ChangedButton != OxyMouseButton.Left)
return;
else
pointx = (int)e0.HitTestResult.NearestHitPoint.X;
};
}
工作代码:
s0.MouseDown += (s, e0) =>
{
if (e0.ChangedButton == OxyMouseButton.Left)
{
var item = e0.HitTestResult.Item as ScatterPoint;
if (item != null)
{
pointx = (int)item.X;
}
}
};
【问题讨论】: