We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Create by code

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">
                                <chart:CategoryAxis Header="Horas" FontSize="14"></chart:CategoryAxis>
                                <chart:NumericalAxis Header="Valores" FontSize="14"></chart:NumericalAxis>
                            <chart:LineSeries XBindingPath="Hour" YBindingPath="Value1" ItemsSource="{Binding powerInd}"></chart:LineSeries>

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?

3 Replies

SR Samuel Rajadurai Edwin Rajamanickam Syncfusion Team April 4, 2016 12:18 PM UTC

Hi Pablo,

Thanks for contacting Syncfusion Support.


We have prepared sample to demonstrate how to create a SfChart in code behind. Please find the sample from the below location.



Please refer the below documentation link for more reference.




PA Pablo April 5, 2016 07:49 AM UTC

Thank you. That is what I was looking for. I already implemented it. 

SJ Sumathi Jayaraj Syncfusion Team April 6, 2016 05:05 AM UTC

Hi Pablo,

Thanks for the update. Please let us know if you have any queries.

Sumathi J

Live Chat Icon For mobile
Up arrow icon