# Is it possible to show Pie chart in such situation?

**URL:** https://discuss.elastic.co/t/is-it-possible-to-show-pie-chart-in-such-situation/41781
**Category:** Kibana
**Created:** [February 15, 2016, 12:32pm UTC](https://discuss.elastic.co/t/is-it-possible-to-show-pie-chart-in-such-situation/41781 "2016-02-15T12:32:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kacemrostom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kacemrostom/32/6926_2.png) [@kacemrostom](https://discuss.elastic.co/u/kacemrostom)
#### Post date: [February 15, 2016, 12:32pm UTC](https://discuss.elastic.co/t/is-it-possible-to-show-pie-chart-in-such-situation/41781/1 "2016-02-15T12:32:45Z")

</div>

Hello everyone one,

So i have around 100 docs stored in Elasticsearch, each one have this following part:

`page_storytellers_by_city: { USA: X, UK: Y, France: Z}`

It indicates the number of visitor from many countries in a given day.

What i want to do is to SUM all numbers for each city in all docs then add them to an overall Pie Chart (that shows % for each city in all docs at once)?  
If it's not possible. should i use the format of tables to achieve that ('i.e

`page_storytellers_by_city: [USA: X, UK: Y, France: Z]` which i can do by restructuring the docs

)

Thanks in advance.

---

<div class="post-metadata">

### Author: ![kacemrostom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kacemrostom/32/6926_2.png) [@kacemrostom](https://discuss.elastic.co/u/kacemrostom)
#### Post date: [February 17, 2016, 11:41am UTC](https://discuss.elastic.co/t/is-it-possible-to-show-pie-chart-in-such-situation/41781/2 "2016-02-17T11:41:36Z")

</div>

Any answer?

---

<div class="post-metadata">

### Author: ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)
#### Post date: [February 19, 2016, 2:12pm UTC](https://discuss.elastic.co/t/is-it-possible-to-show-pie-chart-in-such-situation/41781/3 "2016-02-19T14:12:24Z")

</div>

As this is a nested structure, Kibana can't run aggregations over the values in the nested part of the doc (see [here](https://github.com/elastic/kibana/issues/1084)). I'd suggest denormalizing or using "include\_in\_parent" (1.x) or "copy\_to" (2.x) Elasticsearch mapping to flatten the field, so that you can run aggregations on it.

---

<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:01pm UTC](https://discuss.elastic.co/t/is-it-possible-to-show-pie-chart-in-such-situation/41781/4 "2017-07-06T14:01:40Z")

</div>


