Candlestick dynamic property change in an item of the obserablecollection

Hello,

As captioned, would you send me a sample with sfchart Candlestick dynamic property change at the last item of coll?

Thank

Andrew



1 Reply

DD Devakumar Dhanapoosanam Syncfusion Team May 4, 2022 06:45 AM UTC

Hi Komatora,


We can update the existing data points value dynamically by setting the ListenPropertyChange property of ChartSeries to true and the ChartDataModel should implement the INotifyPropertyChanged as per in the below code example, 

<chart:CandleSeries ItemsSource="{Binding StockPriceDetails}"

                    High="High" Low="Low"

                    Close="Close" Open="Open"
                    ListenPropertyChange
="True"

                    XBindingPath="Date"/>


public  class ChartDataModel : INotifyPropertyChanged

{

    private double high;

 

    public double High

    {

        get { return high; }

        set

        {

            if (value != high)

            {

                high = value;

                RaisePropertyChanged(nameof(High));

            }

        }

    }

    ….

  

    public event PropertyChangedEventHandler PropertyChanged;

 

 

    void RaisePropertyChanged(string name)

    {

        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));

    }

}


Please refer below link for more details.

https://help.syncfusion.com/wpf/charts/databinding#listening-property-changes
https://www.syncfusion.com/kb/3579/how-to-synchronize-the-selection-between-wpf-chart-sfchart-and-datagrid


Please check the above solution and let us know if you need any further assistance on this.


Regards,

Devakumar D


Loader.
Up arrow icon