I try to implement WinRT XAML Toolkit Data Visualization I have a Grouped List of Data
ObservableCollection<Notes> items = await App.DataModel.GetNotes();
var groupedData = (from data in items
group data by data.Title into g
orderby g.Key
select new Group<string, Notes>
{
Key = g.Key.ToString(),
Items = g.ToList()
}).ToList();
List<GroupedDataType> groupedList2 = new List<GroupedDataType>();
foreach (var item in groupedData)
{
int results = 0;
foreach (var rslt in item.Items)
{
results += rslt.Result;
}
groupedList2.Add(new GroupedDataType(results, item.Items[0].Title));
}
PieChart.ItemsSource= groupedList2;
The Class:
public GroupedDataType(int totalresult, string type)
{
TotalResult = totalresult;
Type = type;
}
public int TotalResult { get; set; }
public string Type { get; set; }
The XAML Code :
<Charting:PieSeries x:Name="PieChart"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
IndependentValueBinding="{Binding Type}"
DependentValueBinding="{Binding TotalResult}">
</Charting:PieSeries>
But it doesn't show any chart, please help me know if I did something wrong with my code,
Thank you.