# I have a problem with a pie chart

**URL:** <https://discuss.elastic.co/t/i-have-a-problem-with-a-pie-chart/59414>\
**Category:** Kibana\
**Created:** [August 31, 2016, 10:42am UTC](https://discuss.elastic.co/t/i-have-a-problem-with-a-pie-chart/59414 "2016-08-31T10:42:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paulo\_Difficiliora](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@Paulo\_Difficiliora](https://discuss.elastic.co/u/Paulo_Difficiliora)\
**Post date:** [August 31, 2016, 10:42am UTC](https://discuss.elastic.co/t/i-have-a-problem-with-a-pie-chart/59414/1 "2016-08-31T10:42:11Z")

</div>

I have a problem with a pie chart with these data

{"date" : "2016-01-01","p1":110,"p2":22,"p3":33},  
{"date" : "2016-01-02","p1":120,"p2":102,"p3":32},  
{"date" : "2016-01-02","p1":10,"p2":2,"p3":313}

can i have each slice with the total of the data with respect to time ?

Can you please advise how to solve this issue?

Thx

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [August 31, 2016, 7:54pm UTC](https://discuss.elastic.co/t/i-have-a-problem-with-a-pie-chart/59414/2 "2016-08-31T19:54:30Z")

</div>

You could do a date histogram on your date field, and then a sum metric. It'll look something like:

 ![](https://us1.discourse-cdn.com/elastic/original/2X/f/f3f14aa7d68fbf130b493a493aff899c4d033376.jpg)

The sum aggregation will only work on one of your fields, so for example it'll add up all the p1 values. If you want to sum p1+p2+p3, you can pre-compute at index time or make a scripted field

---

<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, 1:39pm UTC](https://discuss.elastic.co/t/i-have-a-problem-with-a-pie-chart/59414/3 "2017-07-06T13:39:44Z")

</div>


