I need live chart to be updated every 5 millisecond.
I tried to use LiveChart, but it isn't appropriate for me. it crashes after adding 2000 points :D .
Then I used native chart in Visual Studio 2019 ,which I found it in ToolBox, it's better than LiveChart, it doesn't crash, but it works slowly I.e. adding 2000 point to the chart takes 50 seconds! Whereas it should take only 10 seconds.
I use WinForm
I use timer for update chart, set 5 for Interval
Form1_Load:
var chart = chart1.ChartAreas[0];
chart.AxisX.IntervalType = DateTimeIntervalType.Number;
chart.AxisX.LabelStyle.Format = "";
chart.AxisY.LabelStyle.Format = "";
chart.AxisY.LabelStyle.IsEndLabelVisible = true;
chart1.Series.Add("New");
chart1.Series["New"].ChartType = SeriesChartType.Line;
chart1.Series["New"].Color = Color.Red;
chart1.Series[0].IsVisibleInLegend = false;
timer1_Tick:
if (i >= 2000) return;
Random rnd = new Random();
chart1.Series["New"].Points.AddXY(i++, rnd.Next(50));