private void rbch1_CheckedChanged(object sender, EventArgs e) { timer1.Start(); chart1.Series[0].Points.Clear(); } private void Timer1_Tick(object sender, EventArgs e) { t1 += timer1.Interval; if (rbch1.Checked == true) { channelone = new Thread(ch1); channelone.Start(); } } public void ch1() { if (rbch2.Checked == false) { chart1.Invoke((MethodInvoker)(() => chart1.Series[1].Points.Clear())); } String ch1 = txtdata.Text; ; String[] ch1y = ch1.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); for (int a = 1; a < ch1y.Length - 1; a++) { chart1.Invoke((MethodInvoker)(() => chart1.Series[0].Points.AddXY(t1, Convert.ToDouble(ch1y[a])))); chart1.Invoke((MethodInvoker)(() => chart1.ChartAreas[0].AxisX.Minimum = double.NaN)); chart1.Invoke((MethodInvoker)(() => chart1.ChartAreas[0].AxisX.Maximum = double.NaN)); if (chart1.Series[0].Points.Count > sampelsize()) chart1.Invoke((MethodInvoker)(() => chart1.Series[0].Points.RemoveAt(0))); } }
using System.Drawing; List<PointF> Datas = new List<PointF>(); Datas.Add(new PointF(<X>,<Y>));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)