How to use Piechart

Hi,

I've been trying to get a PieChart to work. buy using the table as the datasource how do you go about grouping and counting records?

Hi @Shaun-Hirst,

You can use the GroupBy and Count Linq extension methods.

Hello

To create a PieChart using a table as the data source and group/count records check below steps-

Group your table data based on a specific column.

Count the records in each group.

Prepare the grouped and counted data.

Bind the prepared data to the PieChart component.

Example SQL query:

SELECT category_column, COUNT(*) AS count_column FROM your_table GROUP BY category_column;

var groupedData = from item in yourTable group item by item.CategoryColumn into g select new { Category = g.Key, Count = g.Count() };

Hope this helps!

Best regards,
nolanmaris