PieChart of LiveChart
For using the PieChart, that is very easy, you just need to bind the series collection
Then I just need to get the data from my repo:
var categories = new ObservableCollection(_database.BudgetCategories.GetAllCategories());
SeriesCollection = new SeriesCollection();
foreach (var category in categories)
{
var budgetItems = new ObservableCollection(_database.BudgetItems.GetItemByCategory(category));
double amount = 0;
foreach (var item in budgetItems)
{
amount += (double) item.Amount;
}
var pieSeries = new PieSeries
{
Title = category.Name,
Values = new ChartValues { new ObservableValue(amount) },
DataLabels = true
};
SeriesCollection.Add(pieSeries);
}
}
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 364 feedbacks awaiting moderation...
Form is loading...