# Kibana Pie chart with multiple segments and different aggregations

**URL:** https://discuss.elastic.co/t/kibana-pie-chart-with-multiple-segments-and-different-aggregations/42848
**Category:** Kibana
**Created:** [February 26, 2016, 12:42pm UTC](https://discuss.elastic.co/t/kibana-pie-chart-with-multiple-segments-and-different-aggregations/42848 "2016-02-26T12:42:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gunay](https://avatars.discourse-cdn.com/v4/letter/g/d6d6ee/32.png) [@gunay](https://discuss.elastic.co/u/gunay)
#### Post date: [February 26, 2016, 12:42pm UTC](https://discuss.elastic.co/t/kibana-pie-chart-with-multiple-segments-and-different-aggregations/42848/1 "2016-02-26T12:42:42Z")

</div>

Hi,  
I have a Kibana pie chart with two segments as show in the image. As aggregation each segment has "sum" of a field called "duration.time". I would like have a different aggregation for each segment. For example, "sum" of a field called "duration.time1" for the first segment and "sum" of another field called "duration.time2" for the second segment. Is it possible to do this using the UI of Kibana or modifying the "visState" code of the pie chart. The "visState" for this graph is below. Thanks in advance.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/0/0750682fc63dc4861055e54c1d2270aaa1124391.jpg)

{  
"aggs": [  
{  
"id": "1",  
"params": {  
"field": "duration.time"  
},  
"schema": "metric",  
"type": "sum"  
},  
{  
"id": "2",  
"params": {  
"field": "level0.raw",  
"order": "desc",  
"orderBy": "1",  
"size": 0  
},  
"schema": "segment",  
"type": "terms"  
},  
{  
"id": "3",  
"params": {  
"field": "level1.raw",  
"order": "desc",  
"orderBy": "1",  
"size": 0  
},  
"schema": "segment",  
"type": "terms"  
}  
],  
"listeners": {},  
"params": {  
"addLegend": true,  
"addTooltip": true,  
"isDonut": false,  
"shareYAxis": true  
},  
"type": "pie"  
}

---

<div class="post-metadata">

### Author: ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)
#### Post date: [February 26, 2016, 7:40pm UTC](https://discuss.elastic.co/t/kibana-pie-chart-with-multiple-segments-and-different-aggregations/42848/2 "2016-02-26T19:40:18Z")

</div>

I can't see the rest of your settings as the screenshot clipped off the sub-bucket split slices, but I think you can do what you're asking.

In the screenshot I pasted below, my inner pie (the first bucket of split slices) is aggregated on the Sum of bytes (in your case it would be sum of duration.time1).  
And the second outer pie slices are aggregated on the Sum of memory (in your case it would be sum of duration.time2).

 ![](https://us1.discourse-cdn.com/elastic/original/2X/c/c46fca996b89a4717f353f1913176f5480132f4f.png)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 2:00pm UTC](https://discuss.elastic.co/t/kibana-pie-chart-with-multiple-segments-and-different-aggregations/42848/3 "2017-07-06T14:00:57Z")

</div>


