现有一采集卡,
每隔一定时间采集10000组数据保存在a.txt里,
 Y  
1126
1233
1282
1562
1232
2232
,,,,
,,,,,1232
 
共10000组数据,每隔一定时间(2s)变换一次,
怎样才能把它们用mschart画成实时曲线图呢?横轴为i(i从1到10000),纵轴为Y。
不知道说清楚了么?我该怎么写代码呢?

解决方案 »

  1.   

    装到dataset中好了。直接绑上去。            DataSet ds = new DataSet();
                DataTable dt = ds.Tables.Add();
                DataColumn oTime = new DataColumn("Otime", typeof(string));
                DataColumn rainFall = new DataColumn("col1", typeof(int));
                  .
                  .
                  .
                DataColumn rainFall = new DataColumn("col10000", typeof(int));            ds.Tables[0].Columns.Add(oTime);
                ds.Tables[0].Columns.Add(col1);
                .
                .
                .
               ds.Tables[0].Columns.Add(col10000);for(int i=0;i<=10000;i++)
    {
                    DataRow dr = ds.Tables[0].NewRow();
                   //取数据dr[otime]=
                    //dr[col1]=
                    //dr[col10000]=
                    ds.Tables[0].Rows.Add(dr);
    }
     chart1.DataSource = ds.Tables[0];
      

  2.   

    谢谢楼上们!
                  DataColumn rainFall = new DataColumn("col1", typeof(int));
                  .
                  .
                  .
                DataColumn rainFall = new DataColumn("col10000", typeof(int));二楼的这个我不太明白,要从1写到10000吗?
    能具体帮我写一下吗,谢谢谢谢