Databinding in TeeChart for WPF?
-
- Newbie
- Posts: 4
- Joined: Tue Jul 20, 2010 12:00 am
Databinding in TeeChart for WPF?
Hello,
I've been using TeeChart for a WPF application, but noticed too late that Databinding wasn't implemented in the current version.
So I had to develop the graphs in the "Windows Forms" way (with code behind and control events), instead of using MVVM like the rest of the application.
Later this year, we will have to develop a much bigger application which requires a powerful Charting library.
TeeChart should meet the requirements, except for that Databinding problem which would really be a problem for an application of this size.
So I was wondering if/when an update will be released with the ability to use Databinding in the WPF version of TeeChart?
Thanks in advance!
I've been using TeeChart for a WPF application, but noticed too late that Databinding wasn't implemented in the current version.
So I had to develop the graphs in the "Windows Forms" way (with code behind and control events), instead of using MVVM like the rest of the application.
Later this year, we will have to develop a much bigger application which requires a powerful Charting library.
TeeChart should meet the requirements, except for that Databinding problem which would really be a problem for an application of this size.
So I was wondering if/when an update will be released with the ability to use Databinding in the WPF version of TeeChart?
Thanks in advance!
Re: Databinding in TeeChart for WPF?
Hello Mithrandir,
I have made for you a simple code using a type of DataBinding in TeeChart.WPF and works fine for me. Below you can find the code I am using:
Could you tell us if this type of DataBinding is you want? If it don't like please explain exactly which type of dataBinding do you want achieve?
I hope will helps.
Thanks,
I have made for you a simple code using a type of DataBinding in TeeChart.WPF and works fine for me. Below you can find the code I am using:
Code: Select all
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.WPF.Styles.Bar Series1;
private NameList observable;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Series.Add(Series1 = new Steema.TeeChart.WPF.Styles.Bar());
Series1.XValues.DataMember = "DateOfBirth";
Series1.YValues.DataMember = "Height";
Series1.LabelMember = "LastName";
Series1.ColorMember = "FavoriteColor";
observable = new NameList();
Series1.DataSource = observable;
}
}
public class NameList : System.Collections.ObjectModel.ObservableCollection<Person>
{
public NameList()
: base()
{
Add(new Person("Willa", "Cather", DateTime.Parse("09/22/1941"), Colors.Red, 171));
Add(new Person("Isak", "Dinesen", DateTime.Parse("07/01/1964"), Colors.Green, 189));
Add(new Person("Victor", "Hugo", DateTime.Parse("03/30/1987"), Colors.Blue, 196));
Add(new Person("Jules", "Verne", DateTime.Parse("10/30/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 hope will helps.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 4
- Joined: Tue Jul 20, 2010 12:00 am
Re: Databinding in TeeChart for WPF?
Hello Sandra,
Unfortunately, this is not the type of databinding I need, I should have added more details.
Here is an example of WPF binding I would like to use :
In the View (ChartView.xaml file) :
In the ViewModel (ChartViewModel.vb in a separate project, not in the code behind) :
I hope this helps understanding what I would like to do.
Thank you,
Sébastien
Unfortunately, this is not the type of databinding I need, I should have added more details.
Here is an example of WPF binding I would like to use :
In the View (ChartView.xaml file) :
Code: Select all
<AChart:TChart Series={Binding Path=SeriesList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged} />
Code: Select all
private Series _seriesList;
public Series SeriesList
{
get { return _seriesList; }
set
{
_seriesList = value;
OnPropertyChanged("SeriesList");
}
}
...
public void LoadSeries()
{
foreach (...)
{
//Fill SeriesList
}
Thank you,
Sébastien
Re: Databinding in TeeChart for WPF?
Hello Mithrandir,
Thanks for your example; I haven’t finished understanding which kind of DataBinding do you exactly need? Can you explain exactly how should be your DataBinding?
Thanks,
Thanks for your example; I haven’t finished understanding which kind of DataBinding do you exactly need? Can you explain exactly how should be your DataBinding?
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 4
- Joined: Tue Jul 20, 2010 12:00 am
Re: Databinding in TeeChart for WPF?
Hello Sandra,
Thank you for your quick answer.
I think that the best way I can describe what I mean by WPF Databinding is by sending you an example (a small tutorial) :
http://www.wpftutorial.net/DataBindingOverview.html
It allows you to separate completely the "xaml" layer and the "code" layer.
For example, in my ViewModel (code), I can create a property containing a list of Customers.
This list will be exposed and the View (xaml) can do whatever it wants with it.
It can be bound to a ListView, to a Combobox, or to any list type control.
Each control can display any number of properties of the Customer class. The ViewModel doesn't have to know what the View will do with the List, it just exposes it.
That's the goal of my approach (I'm using the MVVM pattern when developing in WPF, if you don't know what it is, here is an blog explaining the basics of it : http://msdn.microsoft.com/en-us/magazine/dd419663.aspx ).
Thanks.
Best regards,
Sébastien
Thank you for your quick answer.
I think that the best way I can describe what I mean by WPF Databinding is by sending you an example (a small tutorial) :
http://www.wpftutorial.net/DataBindingOverview.html
It allows you to separate completely the "xaml" layer and the "code" layer.
For example, in my ViewModel (code), I can create a property containing a list of Customers.
This list will be exposed and the View (xaml) can do whatever it wants with it.
It can be bound to a ListView, to a Combobox, or to any list type control.
Each control can display any number of properties of the Customer class. The ViewModel doesn't have to know what the View will do with the List, it just exposes it.
That's the goal of my approach (I'm using the MVVM pattern when developing in WPF, if you don't know what it is, here is an blog explaining the basics of it : http://msdn.microsoft.com/en-us/magazine/dd419663.aspx ).
Thanks.
Best regards,
Sébastien
Re: Databinding in TeeChart for WPF?
Hello Sébastien,
I am afraid that is not possible for now. I have added your request in wish-list with number [TW16015359] to be considered inclusion in next maintenance releases.
Thanks,
I am afraid that is not possible for now. I have added your request in wish-list with number [TW16015359] to be considered inclusion in next maintenance releases.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 4
- Joined: Tue Jul 20, 2010 12:00 am
Re: Databinding in TeeChart for WPF?
Hello Sandra,
Thank you for the information.
Best regards,
Sébastien
Thank you for the information.
Best regards,
Sébastien
Re: Databinding in TeeChart for WPF?
Any updates on how can we achieve the above mentioned databinding?
Re: Databinding in TeeChart for WPF?
Any updates on how can we achieve the above mentioned databinding?
Re: Databinding in TeeChart for WPF?
Hello PCCUser,
The feature request with number (TW16015359) isn't still fixed. I have increased its severity to be consider its inclusion in future versions of TeeChart.Net. On the other hand, I recommend you to be aware at this forum, our RSS news feed, twitter and facebook accounts for new release announcements and what's implemented on them.
Thanks,
The feature request with number (TW16015359) isn't still fixed. I have increased its severity to be consider its inclusion in future versions of TeeChart.Net. On the other hand, I recommend you to be aware at this forum, our RSS news feed, twitter and facebook accounts for new release announcements and what's implemented on them.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Databinding in TeeChart for WPF?
Hi,
I also need this data binding feature urgently. Is it implemented now with the latest updates or still in the not
thanks
Ahmed
I also need this data binding feature urgently. Is it implemented now with the latest updates or still in the not
thanks
Ahmed
Re: Databinding in TeeChart for WPF?
Hello Ahmed,
I inform you it isn't implemented in last version of TeeChartFor.Net, because TeeChart.WPF and TeeChart.Silverlight do not support XAML designtime surfaces. You can place a TChart in a XAML page at designtime, but you cannot do any editing on the TChart objects or properties using XAML. I think you can try to use Winforms in WPF as explain in this link, and use the funcionalities of Winforms in wpf.
Thanks,
I inform you it isn't implemented in last version of TeeChartFor.Net, because TeeChart.WPF and TeeChart.Silverlight do not support XAML designtime surfaces. You can place a TChart in a XAML page at designtime, but you cannot do any editing on the TChart objects or properties using XAML. I think you can try to use Winforms in WPF as explain in this link, and use the funcionalities of Winforms in wpf.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Databinding in TeeChart for WPF?
Hi Ahmed,
The last post to this was 2012, it is now 2014, has data binding been implemented in TeeChart for WPF?
Cheers,
Nick
The last post to this was 2012, it is now 2014, has data binding been implemented in TeeChart for WPF?
Cheers,
Nick
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Databinding in TeeChart for WPF?
Databinding in TeeChart for WPF is perfectly possible at runtime using code, but is not possible at designtime using XAML.rsharma wrote: The last post to this was 2012, it is now 2014, has data binding been implemented in TeeChart for WPF?
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |