4
public ChartValues<ObservablePoint> Series1 { get; set; }

public void GeneratePlot(PlotInfo plotInfo)
{
    DataContext = null;

    Series1 = new ChartValues<ObservablePoint>();
    Series1.AddRange(plotInfo.SeriesIn);

    DataContext = this;
}

How can I add point one and wait 200ms and add next point smoothly?

Now program's UI stop for few second and all points are shown.

FoggyFinder
  • 2,230
  • 2
  • 20
  • 34
criser
  • 67
  • 6

1 Answers1

1

Try this:

public async void GeneratePlot(PlotInfo plotInfo)
{
    Series1 = new ChartValues<ObservablePoint>();
    DataContext = this;

    foreach (var x in plotInfo.SeriesIn)
    {
        Series1.Add(x);
        await Task.Delay(200);
    }
}
mm8
  • 163,881
  • 10
  • 57
  • 88