Page 1 of 1

Preferable way to add new points to chart

Posted: Mon Feb 05, 2024 10:45 am
by Micha_el
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()?

Re: Preferable way to add new points to chart

Posted: Mon Feb 05, 2024 12:54 pm
by ArctionKestutis
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.