如何使用以下点画图啊??
X Y
2005-05-10 00:00:00 1063.43
2005-05-10 00:05:00 1004.45
2005-05-10 00:10:00 1018.14
2005-05-10 00:15:00 1036.73
2005-05-10 00:20:00 1036.45
2005-05-10 00:25:00 1039.63
2005-05-10 00:30:00 1045.05
2005-05-10 00:35:00 1052.95
2005-05-10 00:40:00 1056.20
2005-05-10 00:45:00 1068.58
2005-05-10 00:50:00 1038.08
2005-05-10 00:55:00 1020.30
2005-05-10 01:00:00 1056.71
2005-05-10 01:05:00 1039.39
2005-05-10 01:10:00 1033.99
横坐标是时间,纵坐标是数值,还有如何进行坐标的标注呢??怎么编程实现啊?高手帮帮忙,好急的!!
X Y
2005-05-10 00:00:00 1063.43
2005-05-10 00:05:00 1004.45
2005-05-10 00:10:00 1018.14
2005-05-10 00:15:00 1036.73
2005-05-10 00:20:00 1036.45
2005-05-10 00:25:00 1039.63
2005-05-10 00:30:00 1045.05
2005-05-10 00:35:00 1052.95
2005-05-10 00:40:00 1056.20
2005-05-10 00:45:00 1068.58
2005-05-10 00:50:00 1038.08
2005-05-10 00:55:00 1020.30
2005-05-10 01:00:00 1056.71
2005-05-10 01:05:00 1039.39
2005-05-10 01:10:00 1033.99
横坐标是时间,纵坐标是数值,还有如何进行坐标的标注呢??怎么编程实现啊?高手帮帮忙,好急的!!
--------------------------------------------
www.coderpub.com
Graphics.DrawLines,DrawString
{
g=this.CreateGraphics();
}
button_click()
{
try
{
StreamRead sr=new StreamRead("test.txt");
float x1=0;
float y1=0;
float x2=0;
float y2=0;
while ((sr.Readline())!=null)
{
string tmp=sr.Readline();
string x=tmp.split(' ')[0]+tmp.split(' ')[1];
string y=tmp.split(' ')[2];
Point p1=new Point(x1,y1);
x2=x1+5;
y2=System.Convert.ToSingle(y);
Point p2=new Point(x2,y2);
g.DrawLine(this.Pen,p1,p2);
x1=x1+5;
y1=y2;
}
}
catch{}
}你自己试一下,我没装.net,随便写的.还不晓得对不对.大致思路是这样的.
PointPairList list = new PointPairList(); // in ZedGraph
for ( int i=0; i<400; i++ )
{
double x = (double) i;
double y = Math.Sin( (double) i * Math.PI / 15.0 ) * 16.0;
list.Add( x, y );
}