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

Simple LineSeries Chart not displaying

Thread ID:





116518 Jun 4,2014 11:44 AM UTC Jun 5,2014 11:58 AM UTC WinRT 1
Tags: Chart
Asked On June 4, 2014 11:44 AM UTC

Hello all, I'm fairly new to MVVM. I can run the demonstration project and it works, but I cannot seem to get my own simple lineSeries chart up and running in a new project. I cannot figure out why my chart isn't doing anything - when I run my application nothing is displayed, I cannot see the chart, despite in the designer the selectable bounding box appearing in the center of the page. Below is my code:



    <Grid Background="Wheat">
        <Page DataContext="UsersViewModel" />

        <Charts:SfChart HorizontalAlignment="Left" Height="449" Margin="194,139,0,0" VerticalAlignment="Top" Width="949" x:Name="test">


                ItemsSource="{Binding UsersList}"





Code behind (MainPage.xaml.cs)

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

using System.Collections;
using System.Collections.ObjectModel;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace SyncTest
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
        UsersViewModel uvm;
        public MainPage()
            uvm = new UsersViewModel();
            test.Series[0].ItemsSource = uvm.UsersList;

    public class UserProfile
        public DateTime TimeStamp { get; set; }

        public double NoOfUsers { get; set; }

    public class UsersViewModel
        public UsersViewModel()
            this.UsersList = new ObservableCollection<UserProfile>();
            DateTime date = DateTime.Today;
            UsersList.Add(new UserProfile
                TimeStamp = date.AddHours(0.5),
                NoOfUsers = 1000
            UsersList.Add(new UserProfile
                TimeStamp = date.AddHours(1),
                NoOfUsers = 5000
            UsersList.Add(new UserProfile
                TimeStamp = date.AddHours(1.5),
                NoOfUsers = 3000
            UsersList.Add(new UserProfile
                TimeStamp = date.AddHours(2),
                NoOfUsers = 4000
            UsersList.Add(new UserProfile
                TimeStamp = date.AddHours(2.5),
                NoOfUsers = 2000
            UsersList.Add(new UserProfile
                TimeStamp = date.AddHours(3),
                NoOfUsers = 1000
        public ObservableCollection<UserProfile> UsersList

I have also tried again, this time following http://help.syncfusion.com/UG/winrt/default.htm#!Documents/lineseries.htm, but no luck

Am I missing some kind of initialiser out? 


Mohammed Azarudeen [Syncfusion]
Replied On June 5, 2014 11:58 AM UTC

Hi Tom,


We have analyzed the reported code and we need to define the DataContext either for Chart directly or for its parent (i.e., its container) in the code snippet as shown below:







We have prepared the sample by modifying (change DataContext declaration) your code. Please find the sample in the below location.  


Please let us know if you require further assistance on this.



Mohammed Azarudeen

Attachment: Chart_6cf902d3.zip


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