用ZedGraph控件做了柱状图,统计只有在单击统计按钮时才会调用统计绘制柱状图的方法,每次点击统计图都不显示出来,但是调试的时候点击按钮就有统计后的柱状图显示,这是为什么?
zedgraphcontrol 控件问题
答案:1 悬赏:50 手机版
解决时间 2021-05-04 07:50
- 提问者网友:鼻尖触碰
- 2021-05-03 12:46
最佳答案
- 五星知识达人网友:山有枢
- 2021-05-03 13:02
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();
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯