繁体   English   中英

在 C# 中的 ZedGraph 中的图形数据上显示 x、y 和曲线名称时 cursor

[英]Show x, y and curve names when cursor on the graph data in ZedGraph in C#

当 cursor 出现时,我尝试显示 X、Y 和曲线的名称。 我用了

 zedGraphControl1.IsShowPointValues = true;

但这还不够。 我还需要曲线名称。 当 cursor 在曲线上时,图形信息应如下所示:

12/27/2010 12:09 AM, 49.94, ACTIVE_MW

可能吗?

有可能的。 您可以将事件处理程序添加到当您将鼠标悬停在某个点上时触发的 PointValueEvent 事件。

就像是:

this.zedGraphControl1.PointValueEvent += new ZedGraph.ZedGraphControl.PointValueHandler(this.zedGraphControl1_PointValueEvent);

private string zedGraphControl1_PointValueEvent(ZedGraph.ZedGraphControl sender, ZedGraph.GraphPane pane, ZedGraph.CurveItem curve, int iPt)
{
   return curve.Label.Text + " - " + curve.Points[iPt].ToString();
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM