I'm testing SyncFusion sfChart control using your Getting Started documentation (https://help.syncfusion.com/uwp/sfchart/getting-started).
In the example there is Demands ObservableCollection that is displayed on tha chart. Unfortunately, the example works only if Demands collection is filled before chart is created. What if my data gets updated every second (or even faster)? I tried using ListenPropertyChanged, but that didn't help - chart is just empty.
public IO_View()
{
this.InitializeComponent();
SfChart chart = new SfChart();
chart.Header = "Demands Comparison";
//Adding horizontal axis to the chart
CategoryAxis primaryCategoryAxis = new CategoryAxis();
primaryCategoryAxis.Header = "Demands";
chart.PrimaryAxis = primaryCategoryAxis;
//Adding vertical axis to the chart
NumericalAxis secondaryNumericalAxis = new NumericalAxis();
secondaryNumericalAxis.Header = "Values";
chart.SecondaryAxis = secondaryNumericalAxis;
//Initialize the two series for SfChart
ColumnSeries series1 = new ColumnSeries();
series1.ItemsSource = this.Demands;
series1.XBindingPath = "Demand";
series1.YBindingPath = "Year2010";
series1.ListenPropertyChange = true;
ColumnSeries series2 = new ColumnSeries();
series2.XBindingPath = "Demand";
series2.YBindingPath = "Year2011";
series2.ItemsSource = this.Demands;
series2.ListenPropertyChange = true;
//Adding Series to the Chart Series Collection
chart.Series.Add(series1);
chart.Series.Add(series2);
//Adding Legends for the chart
ChartLegend legend = new ChartLegend();
chart.Legend = legend;
//Setting Chart as a Content for the Grid in Page
this.AnalogInputPI.Content = chart;
//for chart:
this.Demands = new ObservableCollection<GoldDemand>
{
new GoldDemand()
{
Demand = "Jewelry", Year2010 = 1998.0, Year2011 = 2361.2
},
new GoldDemand()
{
Demand = "Electronics", Year2010 = 1284.0, Year2011 = 1328.0
},
new GoldDemand()
{
Demand = "Research", Year2010 = 1090.5, Year2011 = 1032.0
},
new GoldDemand()
{
Demand = "Investment", Year2010 = 1643.0, Year2011 = 1898.0
},
new GoldDemand()
{
Demand = "Bank Purchases", Year2010 = 987.0, Year2011 = 887.0
}
};
}