Preferable way to add new points to chart

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
Micha_el
Posts: 7
Joined: Wed Nov 15, 2023 12:25 pm

Preferable way to add new points to chart

Post by Micha_el » Mon Feb 05, 2024 10:45 am

Hi,

as I understand, there are different possibilities to add points to a chart.
One of your demos show that you can define a binding in xaml code to a dependency property defined in the corresponding data context/view model. Adding points to the binding property leads to an automatic update of the chart.

In my use case, I don't know how many different series will be needed, therefore I have to add them in code-behind and not in the xaml. In this case I update the points collection by code like this:
ChartViewXY.PointLineSeries[0].Points = chartControlViewModel.SeriesPoints
This seems to be a way which is also used in your demos. Is this way more or less performant than using a xaml-binding? And does it make a difference if I replace the Points collection like in the code above or instead using PointLineSeries[0].AddPoints()?

ArctionKestutis
Posts: 555
Joined: Mon Mar 14, 2016 9:22 am

Re: Preferable way to add new points to chart

Post by ArctionKestutis » Mon Feb 05, 2024 12:54 pm

In general, bindable edition of LightningChart is slower.
The optimal solution depends on types series used, data flow and other functionality required in application.
To discuss all nuances, please contact 'technical support' directly by email ([email protected]) and provide your subscription ID.

Post Reply