# Pie chart from a single event

**URL:** <https://discuss.elastic.co/t/pie-chart-from-a-single-event/236095>\
**Category:** Kibana\
**Created:** [June 7, 2020, 3:16pm UTC](https://discuss.elastic.co/t/pie-chart-from-a-single-event/236095 "2020-06-07T15:16:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GilKor](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@GilKor](https://discuss.elastic.co/u/GilKor)\
**Post date:** [June 7, 2020, 3:16pm UTC](https://discuss.elastic.co/t/pie-chart-from-a-single-event/236095/1 "2020-06-07T15:16:10Z")

</div>

Hi,

Is it possible to make a pie chart using the value itself in the top hit event?  
for example, I have in my top hit event :  
passCount: 3  
failCount: 1  
skipCount: 0

I want to make a pie chart from that information, could you help me?

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [June 11, 2020, 3:12pm UTC](https://discuss.elastic.co/t/pie-chart-from-a-single-event/236095/2 "2020-06-11T15:12:23Z")

</div>

> Is it possible to make a pie chart using the value itself in the top hit event?

Yes, in the metric configuration select `top hit`. Then select the field you wish to use as the top hit metric.

In the screen shot below, the pie chart is showing the `hour_of_day` as the pie slice percentage.

 ![Screen Shot 2020-06-11 at 9.10.44 AM](https://us1.discourse-cdn.com/elastic/original/3X/1/e/1ee7d1426dc6e781dc1631ca1b653acc10e2ee6e.png)

---

<div class="post-metadata">

**Author:** ![GilKor](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@GilKor](https://discuss.elastic.co/u/GilKor)\
**Post date:** [June 11, 2020, 7:15pm UTC](https://discuss.elastic.co/t/pie-chart-from-a-single-event/236095/3 "2020-06-11T19:15:08Z")

</div>

Hi Nathan,  
Thank you for your answer.

I think you misunderstood my question.  
I am trying to take only the last event(top hit) and look at it "micro" and not "macro".

My meaning is - the pie chart will take the name of a field, take the value it has, and will show it in a pie chart.  
Just like my example, my pie chart will be 75% passCount, and 25% failCount.

Thanks.

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [June 11, 2020, 7:29pm UTC](https://discuss.elastic.co/t/pie-chart-from-a-single-event/236095/4 "2020-06-11T19:29:59Z")

</div>

That is what top hit will do. It will take the value from the first document for the group based on sort configuration.

---

<div class="post-metadata">

**Author:** ![GilKor](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@GilKor](https://discuss.elastic.co/u/GilKor)\
**Post date:** [June 14, 2020, 10:04am UTC](https://discuss.elastic.co/t/pie-chart-from-a-single-event/236095/5 "2020-06-14T10:04:54Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/3/b/3b796339ae576f31fd0c8cf5c02ec7e96009078f.png)

The top hit is passCount:6 failCount:0

the answer here  
field - failConut:0  
value - 1(100%)

Can i ask what version you are running?

---

<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 12, 2020, 10:11am UTC](https://discuss.elastic.co/t/pie-chart-from-a-single-event/236095/6 "2020-07-12T10:11:57Z")

</div>

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