I have a Model with an array[100] of double and I would like to use this directly as the data for the chart. The index value should be the X and the value at that index should be the Y on the chart.
Currently I have to convert the array to a list of points (in my ViewModel) where I store the index value (0-99) as the X of the point and the value of that array index as the Y value of the point.
My xaml looks like this :
<UserControl.DataContext>
<local:ViewModel/>
</UserControl.DataContext>
<Grid>
<syncfusion:SfChart>
<chart:SfChart.PrimaryAxis>
<chart:NumericalAxis/>
</chart:SfChart.PrimaryAxis>
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis/>
</chart:SfChart.SecondaryAxis>
<chart:LineSeries ItemsSource="{Binding Data}" XBindingPath="X" YBindingPath="Y"/>
</syncfusion:SfChart>
</Grid>
</UserControl>
I cannot imagine that this is the best way to get the result ...