It is necessary to do so that you can see the construction of the object in the Chart, but the program did not hang. There is a code without Invoke arranges speed, but the form hangs up.
for (int i = 0; i < vectorDictionary.Count; i++) { List<PointF> l = vectorDictionary[i]; for (int j = 0; j < l.Count; j++) { chart1.Series[i+1].Points.AddXY(l[j].X, l[j].Y); if(j%7==0) chart1.Refresh(); } } With Invoke. Slow speed, as many points to build
await Task.Run(() => { for (int i = 0; i < vectorDictionary.Count; i++) { List<PointF> l = vectorDictionary[i]; for (int j = 0; j < l.Count; j++) { chart1.Invoke(new MethodInvoker(() => { chart1.Series[i+1].Points.AddXY(l[j].X, l[j].Y); })); } } }); How to achieve a visible construction without a form hanging?