I am trying to create a series of charts by code depending of the number of data I have. I have a chart in my xaml, created like this:
<Grid x:Name="Grid_graph">
<Grid.DataContext>
<local:LineChartViewModel></local:LineChartViewModel>
</Grid.DataContext>
<chart:SfChart>
<chart:SfChart.PrimaryAxis>
<chart:CategoryAxis Header="Horas" FontSize="14"></chart:CategoryAxis>
</chart:SfChart.PrimaryAxis>
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis Header="Valores" FontSize="14"></chart:NumericalAxis>
</chart:SfChart.SecondaryAxis>
<chart:LineSeries XBindingPath="Hour" YBindingPath="Value1" ItemsSource="{Binding powerInd}"></chart:LineSeries>
</chart:SfChart>
</Grid>
I want to create the grid (which I already did) and add the datacontext(done) and the "chartSfChart" to include primary/seconday axis and line series. Is it possible? Could I have a line with an example?