# How can I get the data from Elasticsearch which build the Visualization

**URL:** <https://discuss.elastic.co/t/how-can-i-get-the-data-from-elasticsearch-which-build-the-visualization/141164>\
**Category:** Kibana\
**Created:** [July 23, 2018, 12:07pm UTC](https://discuss.elastic.co/t/how-can-i-get-the-data-from-elasticsearch-which-build-the-visualization/141164 "2018-07-23T12:07:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asallemi](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@asallemi](https://discuss.elastic.co/u/asallemi)\
**Post date:** [July 23, 2018, 12:07pm UTC](https://discuss.elastic.co/t/how-can-i-get-the-data-from-elasticsearch-which-build-the-visualization/141164/1 "2018-07-23T12:07:57Z")

</div>

Hello,

I would check if there is a way to get the data from Elasticsearch which builds the Visualization. Let's take this Pie like an example:

 ![a](https://us1.discourse-cdn.com/elastic/original/3X/3/d/3d1f34558517bfc9c0880b221a890970f95c7feb.png)

Now if I click in the red area, I can access to the response which is a list of accounts where the balance is between X and Y (I need the documents).

I don't need this response 😉 :

 ![aaa](https://us1.discourse-cdn.com/elastic/original/3X/7/9/79a33579781d02f1371a1b8f091666295a50a692.png)

Other question, can I access to source code of the Pie plugin and add this this click event ? or I need to build my own Pie plugin ?

Thanks for advance guys ^^  
Akrem.

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [July 23, 2018, 5:13pm UTC](https://discuss.elastic.co/t/how-can-i-get-the-data-from-elasticsearch-which-build-the-visualization/141164/2 "2018-07-23T17:13:47Z")

</div>

hmm, you need the list of documents that are in that range. Easiest way is to have a saved search and the pie on the same dashboard. If you set the filter on the pie chart, the list of documents will be shown in the saved search. You can specify a set of filters for the data. You can specify a filter as a query string or in JSON format, just as in the Discover search bar. Click Add Filter to add another filter. Click the images/labelbutton.png label button to open the label field, where you can type in a name to display on the visualization.  
[https://www.elastic.co/guide/en/kibana/current/pie-chart.html](https://www.elastic.co/guide/en/kibana/current/pie-chart.html)

Cheers  
Rashmi

---

<div class="post-metadata">

**Author:** ![asallemi](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@asallemi](https://discuss.elastic.co/u/asallemi)\
**Post date:** [July 23, 2018, 8:55pm UTC](https://discuss.elastic.co/t/how-can-i-get-the-data-from-elasticsearch-which-build-the-visualization/141164/3 "2018-07-23T20:55:39Z")

</div>

Thank you for the reply @rashmi 🙂, I already know that (maybe I didn't explain well my use case). For example, if I click in this row (see the picture):

 ![aaa](https://us1.discourse-cdn.com/elastic/original/3X/7/3/736f8fb1f2abb337a7d1fb97d2c6b201d5aac598.png)  
I can see the **402 hits or documents** (instead of going to the Discover and add the same filter to display the data from Elasticsearch... ) I hope the requirement is clear now 😄

I need to get the 402 hits which build the **Red area** which I talked about it on the main topic). **Is that possible now?** If yes, how can I do that? if no, have I develop my own Pie plugin (Pie is an example here, if I need the same requirement in other Visualization, I have to recreate it by myself) ?

Best regards ^^

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [July 27, 2018, 4:00pm UTC](https://discuss.elastic.co/t/how-can-i-get-the-data-from-elasticsearch-which-build-the-visualization/141164/4 "2018-07-27T16:00:31Z")

</div>

Hello, the same thing should happen when you click the Pie and when you click the Row in the table. It basically generates a filter that will only show the values in that row/slice. You are looking in the request information right there.

What Rasmi suggested is the way to see all those 402 documents without going to Discover.  
Steps:  
1 Create your Pie Chart.  
2. Open Discover and click on Save without any filter added there. This will generate a saved search that can be embedded on a dashboard.  
3. Create a dashboard with the Pie Chart and the Saved Search next to it.  
4. If you click on the slice of the Pie, the saved search will filter to only see those 402 documents.

---

<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:** [August 24, 2018, 4:00pm UTC](https://discuss.elastic.co/t/how-can-i-get-the-data-from-elasticsearch-which-build-the-visualization/141164/5 "2018-08-24T16:00:31Z")

</div>

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