Hi,
I have an IList Collection. IList<Data>. Data have two propeties "Type" As String and "Count" As Integer.
I want to bind IList<Data> to 3D Pie Chart dynamically. Can you please help me how to achive this?
Thank You,
Regards
Ritesh
Ritesh,
The only thing you have to do in order to bind the Series to IList<Data> or any other collection implementing IEnumerable interface is to set the DataSource and the DataMapping. You can refer to our online documentation for more details :
(http://help.infragistics.com/Help/NetAdvantage/WPF/2009.1/CLR3.X/html/xamChart_Binding_xamChart_to_a_Collection.html)
void Window1_Loaded(object sender, RoutedEventArgs e) { IList<Data> list=new List<Data>();
Data d1 = new Data() { Type = "T1", Count = 20 }; Data d2 = new Data() { Type = "T2", Count = 30 }; ...
list.Add(d1); list.Add(d2); ...
Series s = new Series(); s.ChartType = ChartType.Pie; s.DataSource = list; s.DataMapping = "Value=Count;Label=Type";
xamChart1.View3D = true; xamChart1.Series.Add(s); }
Let me know if you have any questions with this matter.
Vlad