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

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

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

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