You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing a Instrument control software Desktop application(.net 6, Avalonia, MVVM, ReactiveUI) that interact with an FPGA.
I am getting 10000 data points every 100ms from the FPGA
I am trying to use LiveCharts2 to display the points every second, getting the last available array of points from FPGA ( I don't need to display every 100ms , it would be nice if I could though)
I am running into an issue where it seems Livecharts2 can not keep up with that numbers of point.
With 1000 and up 5000 the ui stay responsive but with 10000 it is lagging.
I am using:
Livecharts2 20.0.0-beta.701
Avalonia 0.10.19
.Net6
I saw, from release beta.350, there might be an assembly available to improve performance, when will it be available?
Is there anything I can do in the meantime to improve my performance?
publicObservableCollection<ISeries>DataSeries{get;set;}=newObservableCollection<ISeries>{newLineSeries<TimeTraceData>{Name="PMT1",Fill=null,DataPadding=newLvcPoint(0.2f,0),Stroke=null,// Stroke = new SolidColorPaint {// Color = SKColors.LightGreen,// StrokeCap = SKStrokeCap.Round,// StrokeThickness = _strokeThickness,// PathEffect = new DashEffect(_strokeDashArray)// },GeometryStroke=newSolidColorPaint(SKColors.LightGreen,1),LineSmoothness=1,GeometrySize=5,Mapping=(data,point)=>{// use the Population property in this seriespoint.PrimaryValue=data.PMTsVolts[0];//point.SecondaryValue = point.Context.Index;point.SecondaryValue=data.TimestampMs;},},};
Reactive code in Viewmodel to trigger chart redraw with latest data acquired by fpga
vart=Fpga.TimeTraceDataList// Convert the collection to a stream of chunks,// so we have IObservable<IChangeSet<TKey, TValue>>// type also known as the DynamicData monad..ToObservableChangeSet().Sample(TimeSpan.FromSeconds(1)).Select(x =>x).ObserveOn(RxApp.MainThreadScheduler).SubscribeOn(RxApp.TaskpoolScheduler);t.Subscribe(c =>{if(c.Count>0){varnewItems=Fpga.TimeTraceDataList.Last();DataSeries[0].Values=newItems;XAxes[0].MinLimit=newItems.First().TimestampMs;XAxes[0].MaxLimit=newItems.Last().TimestampMs;Console.Error.WriteLine($"Chart Update Trigger {_sw.ElapsedMilliseconds}");}}).DisposeWith(disposables);
c# public ObservableCollection<TimeTraceData[]> TimeTraceDataList { get; set; } = new();
TimeTraceDataList is a property of the FPGA device implementation updated on a separate thread.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am developing a Instrument control software Desktop application(.net 6, Avalonia, MVVM, ReactiveUI) that interact with an FPGA.
I am getting 10000 data points every 100ms from the FPGA
I am trying to use LiveCharts2 to display the points every second, getting the last available array of points from FPGA ( I don't need to display every 100ms , it would be nice if I could though)
I am running into an issue where it seems Livecharts2 can not keep up with that numbers of point.
With 1000 and up 5000 the ui stay responsive but with 10000 it is lagging.
I am using:
Livecharts2 20.0.0-beta.701
Avalonia 0.10.19
.Net6
I saw, from release beta.350, there might be an assembly available to improve performance, when will it be available?
Is there anything I can do in the meantime to improve my performance?
See snippet of my code below , Test application is available here: https://github.com/agillet76/livechart-avalonia-crash/tree/main
view.xaml
ViewModels
Reactive code in Viewmodel to trigger chart redraw with latest data acquired by fpga
c# public ObservableCollection<TimeTraceData[]> TimeTraceDataList { get; set; } = new();
TimeTraceDataList is a property of the FPGA device implementation updated on a separate thread.
Screenshots:
1000 data points
10000 data points

Beta Was this translation helpful? Give feedback.
All reactions