# Draw Pie Chart in Kibana based on field values

**URL:** <https://discuss.elastic.co/t/draw-pie-chart-in-kibana-based-on-field-values/262077>\
**Category:** Kibana\
**Created:** [January 25, 2021, 10:10am UTC](https://discuss.elastic.co/t/draw-pie-chart-in-kibana-based-on-field-values/262077 "2021-01-25T10:10:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sudarshan\_Reddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sudarshan_reddy/32/82835_2.png) [@Sudarshan\_Reddy](https://discuss.elastic.co/u/Sudarshan_Reddy)\
**Post date:** [January 25, 2021, 10:10am UTC](https://discuss.elastic.co/t/draw-pie-chart-in-kibana-based-on-field-values/262077/1 "2021-01-25T10:10:39Z")

</div>

Hi , we have a requirement to some of our test results in kibana pie chart .  
e.g we have the index pattern as following with the fields and i want to plot passedCount, failedCount values in kibana Pie Chart with each timestamp .

```
   timestamp: Jan 25, 2021 @ 14:34:02.110 ,
   messsage: "TAP Execution completed", 
   passedCount: 15, 
   failedCount: 11

```

As we use aggregations based on no of entries in logs , but not based on values . please suggest how do we use values to draw pie charts

---

<div class="post-metadata">

**Author:** ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)\
**Post date:** [February 1, 2021, 7:11am UTC](https://discuss.elastic.co/t/draw-pie-chart-in-kibana-based-on-field-values/262077/2 "2021-02-01T07:11:15Z")

</div>

Hello Sudarshan,

I don't fully understand your question. You have an index with this documents, where for every timestamp you would log such a document wit hapssedCount and failedCount ?

now you want to draw a piechart for each specific timestamp ?

i think this is not possible in kibana at the moment.

what you could do is draw a bar chart, where for every timestamp you have two bars: one showing failed count and the other showing passed count:

- go to bar chart visualizaton, for your x axis choose date histogram aggregation over timestamp field
- add two metrics (and remove count metric): SUM for the field 'passedCount' and the other one SUM for the field 'failedCount'

hopefully this is helpful

---

<div class="post-metadata">

**Author:** ![Sudarshan\_Reddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sudarshan_reddy/32/82835_2.png) [@Sudarshan\_Reddy](https://discuss.elastic.co/u/Sudarshan_Reddy)\
**Post date:** [February 3, 2021, 7:09am UTC](https://discuss.elastic.co/t/draw-pie-chart-in-kibana-based-on-field-values/262077/3 "2021-02-03T07:09:26Z")

</div>

Thanks Peter. it works for bar chart .

---

<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:** [March 3, 2021, 7:10am UTC](https://discuss.elastic.co/t/draw-pie-chart-in-kibana-based-on-field-values/262077/4 "2021-03-03T07:10:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
