c# ZedGraph控件一个小问题
ZedGraph制作更新的曲线。我要做一个曲线,去曲线引用了变量v=Convert.ToDouble(textBox1.Text);然后有个按钮,现在我希望填完数字,点下...
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();
}
我要的是填入数据点下按钮就更新曲线,把v = Convert.ToDouble(textBox1.Text);放到那个位置上不起作用的。 展开
我要做一个曲线,去曲线引用了变量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();
}
我要的是填入数据点下按钮就更新曲线,把v = Convert.ToDouble(textBox1.Text);放到那个位置上不起作用的。 展开
2个回答
展开全部
private void CreateGraph(ZedGraphControl zgc)
{
v = Convert.ToDouble(textBox1.Text);
// 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();
}
{
v = Convert.ToDouble(textBox1.Text);
// 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();
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询