C#文本文件数据到数据集&图表 [英] C# text file data to data set & charts

查看:94
本文介绍了C#文本文件数据到数据集&图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好Every1 ......

我正在做一个需要以图形方式表示从串行端口获取的数据的项目.首先,我将串行端口上可用的所有ascii类型数据发送/存储到文本文件中.这样就完成了,

我想将此数据加载到数据集,然后需要以图形形式表示它们. (图表,图表等).

文本文件内容:-

Hello Every1......

Im doing a project that required to graphically represent the acquired data from the serial port. First I send/ store all the ascii type data available at the serial port to a text file. So that part is done,

I want to load this data to a data set and after that need to represent them in a graphical form. (plot graphs, charts etc).

Text file content :-

0.00
1.00
.
.
50.00
.
150
.
.
2000



所以我可以逐行阅读文本文件:).

这些是我的问题:
1.是否可以在不将其转换为数字形式的情况下绘制这些ascii值?
2.制作此图形场景的最佳方法是什么?将所有这些asciis加载到数据集/表中.将它们转换成数字形式并绘制图形?还是有更好的方法?
3.我想在电子表格视图中表示数值数据!最好的方法是什么?数据网格视图,集合或表

任何帮助的想法将不胜感激

Thanx



So I can read the text file line by line :).

These are my questions:
1. Can I plot these ascii values without convert them to a numerical form ?
2. What is the best way to do this graphic scene ? load all these asciis to data set/ table --> convert them into a numerical form and plot a graph ? or is there a better way ???
3. I want to represent numerical data in a spread sheet view ! what is best way ? data grid view, set or table ???

Any helps ideas would be appreciated

Thanx

推荐答案

您可以逐行阅读文件: Microsoft图表控件 [
You can read the file line by line: A simple Google search[^]

1. You can''t, because strings don''t have a numerical value. So you must convert them to double (perhaps an array or a list).

2. You could use Microsoft Charting control[^] and a fast line chart.

3. I would use DataGridView because it''s simple and quite customizable.


这篇关于C#文本文件数据到数据集&图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆