在c#winform里面如何画波形图???
我要在c#中画一张以时间为横轴,TextBox中的值为纵轴的波形图,这个该怎么画?
------解决方案--------------------
public Form1()
{
InitializeComponent();
}
/// <summary>
/// 数据点结构
/// </summary>
struct DataPoint
{
public int V;
public DateTime T;
}
private const int n = 20;//点数
private int vMax = 1;//最大值
private const int r = 6;//点半径
private DataPoint[] data = new DataPoint[n];//数据点
private Point[] points = new Point[n];//坐标点
/// <summary>
/// 添加数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < n - 1; i++)
{
data[n - i - 1] = data[n - i - 2];
}
data[0].T = DateTime.Now;
try
{<