ZedGraph控件一个小问题

yutuxilie 2010-02-04 09:47:56
ZedGraph制作更新的曲线。
我要做一个曲线,去曲线引用了变量v = Convert.ToDouble(textBox1.Text);
然后有个按钮,现在我希望填完数字,点下按钮表格区域就能更新出曲线
现在我的曲线就不能和按钮关联更新我应该在那里加东西?
private void CreateGraph(ZedGraphControl zgc)
{
// get a reference to the GraphPane
GraphPane myPane = zgc.GraphPane;

// Set the Titles
myPane.Title.Text = "抛物线";
myPane.XAxis.Title.Text = "落点";
myPane.YAxis.Title.Text = "高度";

// Make up some data arrays based on the Sine function
double x, y1;
PointPairList list1 = new PointPairList();
for (int i = 0; i < 36; i++)
{
x = (double)i + 5;
y1 = (double)i*Math.Sin(v)
list1.Add(x, y1);
}

LineItem myCurve = myPane.AddCurve("物体",
zgc.AxisChange();
}
...全文
71 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
peterb 2010-02-04
  • 打赏
  • 举报
回复
yutuxilie 2010-02-04
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 yadongkang 的回复:]
参考:
http://school.itzcn.com/special-spid-12.html
上面讲解的比较详细,希望对楼主有所帮助。
[/Quote]
谢谢我再回头看看教程然后再想想任银河解决
yutuxilie 2010-02-04
  • 打赏
  • 举报
回复
我在最后加了句this.zedGraphControl1.Refresh();但是不起效果~~
private void button1_Click(object sender, EventArgs e)
{
……………………………………
……………………………………
……………………………………
this.zedGraphControl1.Refresh();

}
l13873666736 2010-02-04
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 yutuxilie 的回复:]
弱弱的问一句
button_click()
{
refresh();
}
应该加在哪里
[/Quote]
這個是讓你刷新界面,這樣ZED會重畫。
yutuxilie 2010-02-04
  • 打赏
  • 举报
回复
弱弱的问一句
button_click()
{
refresh();
}
应该加在哪里
michaelnami 2010-02-04
  • 打赏
  • 举报
回复
button——click()

refresh();
wuyq11 2010-02-04
  • 打赏
  • 举报
回复

111,120

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧