# Pie chart with list

**URL:** <https://discuss.elastic.co/t/pie-chart-with-list/294342>\
**Category:** Kibana\
**Created:** [January 13, 2022, 11:45pm UTC](https://discuss.elastic.co/t/pie-chart-with-list/294342 "2022-01-13T23:45:10Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [January 15, 2022, 11:34am UTC](https://discuss.elastic.co/t/pie-chart-with-list/294342/6 "2022-01-15T11:34:10Z")

</div>

I see, but it is not straight-forward but a difficult problem with elasticsearch.

> [@Count of value in array field](https://discuss.elastic.co/t/count-of-value-in-array-field/207302):
>
> Based on this post "[https://discuss.elastic.co/t/count-of-values-on-array-field-on-visualization/72501](https://discuss.elastic.co/t/count-of-values-on-array-field-on-visualization/72501)" which is posted since Jan 2017 Do we able to do it with the current Kibana (7.x)?

So you have to take alternatives with some compromise. There are several approaches that are quite different.

As far as I can think of, there are

1. use logstash split filter plugin to create a new index with new atomic document.  
eg  
{"ENV": "A", "Login": {"status": "passed"}}  
{"ENV": "B", "Login": {"status": "passed"}}  
{"ENV": "C", "Login": {"status": "passed"}} ...  
This is the structure of documents that kibana is good at, and you can realize various visualizations relatively freely.

2. create script fields of counting each 'pass' and 'fail' values in LoginListStatus and use "Bar vertical percentage" visualization of lens.

---

_[View the full topic](https://discuss.elastic.co/t/pie-chart-with-list/294342)._
