无法使用 NumericUpDown 更新 ZedGraph 中的 YAxis
我正在尝试增加/减少 ZedGraph 中 Y 轴的最大值和最小值。当我创建表单时,图形会正常绘制,但在第一次绘制后,我想使用 2 numericUpDown 控件更改 Y 轴的比例...但它永远不会更新:(
这是我正在使用的代码:
private void CreateGraph()
{
// Set the Titles
myPane.Title.Text = gs.Title;
myPane.XAxis.Title.Text = gs.xTitle;
myPane.YAxis.Title.Text = gs.yTitle;
//Add data
myPane.AddCurve(gs.LineLabel, gs.RawData, gs.LineColor);
zedGraphControl1.AxisChange();
}
private void nudYMax_ValueChanged(object sender, EventArgs e)
{
this.zedGraphControl1.GraphPane.YAxis.Scale.Max = (double)nudYMax.Value;
zedGraphControl1.AxisChange();
}
private void nudYMin_ValueChanged(object sender, EventArgs e)
{
this.myPane.YAxis.Scale.Min = (double)nudYMin.Value;
zedGraphControl1.AxisChange();
}
I am trying to increase/decrease Max and Min value of Y axis in a ZedGraph. When I create the form, the graph draws as normal, but after first draw I want to change the scale of Y axis using 2 numericUpDown controls...but it never updates :(
Here is the code I am using:
private void CreateGraph()
{
// Set the Titles
myPane.Title.Text = gs.Title;
myPane.XAxis.Title.Text = gs.xTitle;
myPane.YAxis.Title.Text = gs.yTitle;
//Add data
myPane.AddCurve(gs.LineLabel, gs.RawData, gs.LineColor);
zedGraphControl1.AxisChange();
}
private void nudYMax_ValueChanged(object sender, EventArgs e)
{
this.zedGraphControl1.GraphPane.YAxis.Scale.Max = (double)nudYMax.Value;
zedGraphControl1.AxisChange();
}
private void nudYMin_ValueChanged(object sender, EventArgs e)
{
this.myPane.YAxis.Scale.Min = (double)nudYMin.Value;
zedGraphControl1.AxisChange();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
自从我使用 ZedGraph 库以来已经很久了,但如果我没记错的话,你必须
在轴更改后调用。
It's a long time ago since i worked with the ZedGraph library but if I remember correctly you have to call
after your axis change.