Page 1 of 1

Datasource of Silverlight Teechart

Posted: Tue Feb 10, 2009 9:35 am
by 13046610
Hi,
I am evaluating TeeChart v4 Silverlight.

What can be the Chartseries Datasource?

I tried to bind Chart Series to ObservableCollection<>, but it doesn't work.


ObservableCollection<Customer> coll = new ObservableCollection<Customer>();
//code to fill the collection.....

Line lineSeries1 = new Line();
tChart1.Series.Add(lineSeries1);
lineSeries1.Title = "line1";
lineSeries1.XValues.DataMember = "Age";
lineSeries1.YValues.DataMember = "Salary";
lineSeries1.DataSource = coll;


Regards,
Priya

Posted: Tue Feb 10, 2009 2:05 pm
by narcis
Hi Priya,

Have you tried something as Christopher Ireland's example here?

Posted: Wed Feb 11, 2009 4:50 am
by 13046610
Hi Narcis,

No, I am not trying as Christopher Ireland's example.

I simply want to bind the datasource to Silverlight Teechart.
Since Silverlight does not have ADO.Net, Silverlight Teechart can not be binded to Dataset. That's why I am trying to bind it to ObservableCollection. But the chart doesn't get plotted.

What can be other possible datasources for Silverlight Teechart?

Any feedback would be appreciated.

Regards,
Priya

Posted: Thu Feb 12, 2009 11:22 am
by narcis
Hi Anil,

Thanks for the information. I see we already spoke about this issue here. There are no news about this yet.

Posted: Mon Feb 16, 2009 12:07 pm
by 13046610
Sorry, Narcis. I guess there is some confusion.
I already have TeeChart v4 Silverlight beta provided by Steema Sales team. API documentation is not provided with it.
Isn't there way to bind Silverlight Teechart with some datasource? If yes, What are the datasources which can be bound?

Regards,
Priya

Posted: Wed Feb 18, 2009 9:36 am
by narcis
Hi Priya,

Yes, but at that thread I was also speaking about v4 Silverlight beta as there's no Silverlight version of TeeChart for .NET v3. v4's beta is the first TeeChart Silverlight version available. Anyway, a new beta has been uploaded at our website which accepts objects of type ObservableCollection<T> for Series DataSource. Here's an example:

Code: Select all

  public partial class Page : UserControl
  {
    public Page()
    {
      InitializeComponent();
      InitializeChart();
    }

    private Steema.TeeChart.Silverlight.Styles.Bar bar;
    private NameList observable;
    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      tChart1.Series.Add(bar = new
Steema.TeeChart.Silverlight.Styles.Bar());

      bar.XValues.DataMember = "DateOfBirth";
      bar.YValues.DataMember = "Height";
      bar.LabelMember = "LastName";
      bar.ColorMember = "FavoriteColor";

      observable = new NameList();
      bar.DataSource = observable;
    }
  }

  public class NameList : ObservableCollection<Person>
  {
    public NameList()
      : base()
    {
      Add(new Person("Willa", "Cather", DateTime.Parse("22/09/1941"), Colors.Red, 171));
      Add(new Person("Isak", "Dinesen", DateTime.Parse("01/07/1964"), Colors.Green, 189));
      Add(new Person("Victor", "Hugo", DateTime.Parse("30/03/1987"), Colors.Blue, 196));
      Add(new Person("Jules", "Verne", DateTime.Parse("14/10/1995"), Colors.Orange, 175));
    }
  }

  public class Person
  {
    private string firstName;
    private string lastName;
    private DateTime dob;
    private Color favorite;
    private int height;

    public Person(string first, string last, DateTime dob, Color favorite, int height)
    {
      this.firstName = first;
      this.lastName = last;
      this.dob = dob;
      this.favorite = favorite;
      this.height = height;
    }

    public string FirstName
    {
      get { return firstName; }
      set { firstName = value; }
    }

    public string LastName
    {
      get { return lastName; }
      set { lastName = value; }
    }

    public DateTime DateOfBirth
    {
      get { return dob; }
      set { dob = value; }
    }

    public Color FavoriteColor
    {
      get { return favorite; }
      set { favorite = value; }
    }

    public int Height
    {
      get { return height; }
      set { height = value; }
    }
  }
I'll send you an e-mail, to your forums contact e-mail address, with the URL to download the version.

Posted: Mon Feb 23, 2009 4:23 am
by 13046610
Hi Narcis,

Can you please resend the Download URL at new email-id?
I have updated the email address. Earlier it was resalers's email address.

Thanks,
Priya

Posted: Mon Feb 23, 2009 8:20 am
by narcis
Hi Priya,

Sure, no problem. Just resent the e-mail to your new address.

Posted: Mon Feb 23, 2009 8:50 am
by 13046610
Thanks alot, Narcis.
The SilverLight Teechart binding with ObservableCollection is working fine now :D

Can I get beta download for Teechart .NET 4 for WPF as well?
I have WPF Teechart .NET version 3 which does not support ObservableCollection. We are creating controls for Silverlight and WPF whose API going to be same.

Thanks,
Priya

Posted: Tue Feb 24, 2009 9:36 am
by narcis
Hi Priya,

Such beta doesn't exist at the present moment. A beta version of the next TeeChart for .NET major upgrade release, will be made available early March.