This is a migrated thread and some comments may be shown as answers.

Kendo Pie Chart Sum, Count, Avg

2 Answers 440 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Gokhan asked on 17 Oct 2014, 12:14 PM
I have a problem with Kendo Pie chart about "Aggregate" functions(count, sum, average).Everyting works with Bar or Column chart but when i try to show pie chart i can't use count, sum, average functions of Kendo Pie Chart's.

I can show my values invidually but i can't group my values(like euro, dolar, lira)How can i group my values and show them with Pie chart?

Here is my model:
public decimal MoneyValue{ get; set; }
public string MoneyName{ get; set; }

My values are coming like that with Pie Chart.:
Euro - 10
Dolar- 100
Dolar - 50
Euro -15
Dolar - 50
Lira - 45

I need to show values like that:
Euro - Count: 2 Total:25 Avg: 12,5
Dolar - Count: 3 Total: 200 Avg: 66,6
Lira Count: 1 Total: 200 Avg: 200

View Code

View Code@(Html.Kendo().Chart(Model)
.Title(title => title
.Legend(legend => legend
.Series(series =>
series.Pie(model => model.MoneyValue, categoryExpression: model => model.MoneyName);
// .Aggregate(ChartSeriesAggregate.Count)
//.Labels(labels => labels.Visible(true).Position(ChartBarLabelsPosition.Center));

//here i get the error. It shows there is no .Aggregate function so i can't group my values.


.Tooltip(tooltip => tooltip
.Template("#= category #: #= value #"))
.Events(ev => ev.DataBound("onDB"))


Kendo Count - Sum - Average functions:(i've no problem with them, they work correctly.)<div class="configuration-horizontal">

<div class="config-section">
<span class="configHead">Grafik </span>
<ul class="options">

<input id="aggregateSum" name="aggregate" type="radio" value="sum" autocomplete="off" />


<input id="aggregateAvg" name="aggregate" type="radio" value="avg"
autocomplete="off" />


<input id="aggregateCount" name="aggregate" type="radio" value="count" checked="checked" autocomplete="off" />



$(".configuration-horizontal").bind("change", refresh);

function refresh() {
var chart = $("#chart").data("kendoChart"),
series = chart.options.series,
categoryAxis = chart.options.categoryAxis,
baseUnitInputs = $("input:radio[name=baseUnit]"),
aggregateInputs = $("input:radio[name=aggregate]");

for (var i = 0, length = series.length; i < length; i++) {
series[i].aggregate = aggregateInputs.filter(":checked").val();

categoryAxis.baseUnit = baseUnitInputs.filter(":checked").val();


2 Answers, 1 is accepted

Sort by
Hristo Germanov
Telerik team
answered on 17 Oct 2014, 01:18 PM
Hello Gokhan,

Currently the Kendo UI Chart doesn't support aggregates for Pie series. I would suggest to submit your request in Kendo's UserVoice so other members of the community can evaluate, comment on and vote for it. 

Hristo Germanov

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Top achievements
Rank 1
answered on 17 Oct 2014, 01:57 PM
Thank you. I will.
Asked by
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Top achievements
Rank 1
Share this question