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.
Unfortunately, activation email could not send to your email. Please try again.

Create by code

Thread ID:

Created:

Updated:

Platform:

Replies:

123588 Apr 1,2016 07:24 AM Apr 6,2016 01:05 AM UWP 3
loading
Tags: SfChart
Pablo
Asked On April 1, 2016 07:24 AM

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?

Samuel Rajadurai Edwin Rajamanickam [Syncfusion]
Replied On April 4, 2016 08:18 AM

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.

Chart_Code

 

Please refer the below documentation link for more reference.

http://help.syncfusion.com/uwp/sfchart/getting-started#create-a-simple-chart-from-code-behind


Regards,

Samuel


Pablo
Replied On April 5, 2016 03:49 AM

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

Sumathi Jayaraj [Syncfusion]
Replied On April 6, 2016 01:05 AM

Hi Pablo,

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

Regards,
Sumathi J

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;