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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

First time user: Cannot draw a simpe lien chart

Thread ID:





129109 Feb 28,2017 06:51 AM UTC Mar 2,2017 03:52 AM UTC UWP 3
Tags: SfChart
Berk Celebisoy
Asked On February 28, 2017 06:51 AM UTC

Here is what I am doing and nothing is happening. I don't see anything drawn on the chart. Can you pls help me figure out what I am doing wrong?

//in .cs file:
class SeriesData {
   string m_year;
   double m_portVal;
  public SeriesData(string year, double portVal) {
     m_year = year;
     m_portVal = portVal;
  public string Year { get; set; }
  public double PortVal { get; set; }
ObservableCollection obsvrColl = null;
LineSeries series1 = new LineSeries();

later when a button is clicked:
Foo() {
obsvrColl = new ObservableCollection();

for (int i = 0; i < m_userData.Years; i++)
    obsvrColl.Add(new SeriesData(i.ToString(), i*100));

series1.ItemsSource = obsvrColl;
series1.XBindingPath = "Year";
series1.YBindingPath = "PortVal";
this.DataContext = this;
//in XAML:
            <syncfusion:SfChart x:Name="chartGrowth"  Grid.Row="1" Grid.Column="0" Header="Portfolio Growth" FontSize="12">
                <!--Initialize the horizontal axis for SfChart-->
                    <syncfusion:CategoryAxis Header="Demands" FontSize="12"/>

                <!--Initialize the vertical axis for SfChart-->
                    <syncfusion:NumericalAxis Header="Values" FontSize="12"/>

                <!--Adding Legend to the SfChart-->
                    <syncfusion:ChartLegend Visibility="Visible"/>

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On March 1, 2017 11:44 AM UTC

Hi Berk, 
Thanks for contacting Syncfusion Support. 
Since the XBindingPath and YBindingPath property values (Year, PortVal) are not assigned and the ObservableCollection for series items source is not defined properly, the chart series does not render. We have prepared a demo sample based on your requirement with the reference of provided code snippet. The sample can be downloaded from below link, 
Please refer our UG documentation link for getting started into SfChart, 

Berk Celebisoy
Replied On March 1, 2017 05:18 PM UTC

Devi - Thank you for getting back to me. Your sample code solves my problem. You're awesome!!! Thanks!   ;-)

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On March 2, 2017 03:52 AM UTC

Hi Berk, 
Thanks for your update. 
Please let us know, if you need any further assistance on this. 


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon