# How to create a custom dropdown which will populate the elasticsearch multi bucket data as different bar charts

**URL:** <https://discuss.elastic.co/t/how-to-create-a-custom-dropdown-which-will-populate-the-elasticsearch-multi-bucket-data-as-different-bar-charts/305033>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [May 18, 2022, 8:11am UTC](https://discuss.elastic.co/t/how-to-create-a-custom-dropdown-which-will-populate-the-elasticsearch-multi-bucket-data-as-different-bar-charts/305033 "2022-05-18T08:11:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priya\_Bari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priya_bari/32/105823_2.png) [@Priya\_Bari](https://discuss.elastic.co/u/Priya_Bari)\
**Post date:** [May 18, 2022, 8:11am UTC](https://discuss.elastic.co/t/how-to-create-a-custom-dropdown-which-will-populate-the-elasticsearch-multi-bucket-data-as-different-bar-charts/305033/1 "2022-05-18T08:11:15Z")

</div>

I am trying to create a custom visualization for which will be fetching details from Elasticsearch using following query

```auto
GET sample/_search
{
  "aggs": {
    "open_entries": {
      "filter": {
        "range": {
          "status.keyword": {
            "lt": 100
          }
        }
      },
      "aggs": {
        "owner1_bucket": {
          "terms": {
            "field": "owner1.keyword", 
            "size": 1000
          }
        },
        "owner2_bucket": {
          "terms": {
            "field": "owner2.keyword",
            "size": 1000
          }
        },
        "amount_bucket" :{
          "terms": {
            "field": "amount.keyword",
            "size": 1000
          }
        }
      }
    }
  },
  "size": 0
}

```

How can I create a dropdown which has options same as the buckets fetched using above query  
i.e. ['owner1', 'owner2', 'amount']  
and as per the choice a graph will be displayed for the respective bucket.

e.g.

if user choose owner1, then the bar graph will be displayed with x axis as the owner1 names and y axis as the count

---

<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:** [June 15, 2022, 8:12am UTC](https://discuss.elastic.co/t/how-to-create-a-custom-dropdown-which-will-populate-the-elasticsearch-multi-bucket-data-as-different-bar-charts/305033/2 "2022-06-15T08:12:02Z")

</div>

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