I'm using Visual Studio 2017 and am trying to make a program that shows real-time values in a scatter chart, using C# and winform.
With the source code below, I was able to make it show real-time values, whenever an event occurs and it gets a new value(3~5 times a second).
valueArray continuously gets new values through GetRealTimeData function and the chart shows all the elements in the array.
valueArray[valueArray.Length - 1] = Convert.ToDouble(GetRealTimeData().Trim());
Array.Copy(valueArray, 1, valueArray, 0, valueArray.Length - 1);
this.chart1.Series["Series1"].Points.Clear();
this.chart1.Series["Series1"].Points.DataBindY(valueArray);
However, I have a problem using this program, which is it consumes much computer resource even when it shows 3,000 values in the chart.
I plan to make the chart represent 50,000 to 100,000 values, but I think it uses up too much resource copying and showing old values everytime it gets a new value.
I'd like to know if there are any functions or methods to do this kind of job. I would appreciate it if I could get some advices or ideas.