title: Elasticsearch buckets on results of aggregation
body: <p>I am using ELK 7.x. I would like a histogram or bar chart in Kibana on the results of an aggregation. As it's a bit abstract to explain, below is the equivalent SQL query.</p>
  
  <pre><code>select count(*) as no_of_docs, doc_type 
  from documents
  group by doc_type
  
  15     pdf
  21     doc
  17     txt
   1     ppt
  </code></pre>
  
  <p>A histogram or any chart as below:</p>
  
  <pre><code>No of docs        Count of doc type 
  (X-Axis)          (Y-Axis) 
  1-10              1 [1 ppt occurrence in the 1-10 bucket]
  11-20             2 [1 pdf, 1 txt occurrences in the 11-20 bucket]
  21 and above      1 [1 doc occurrence in the 21 and above  bucket]
  </code></pre>
  
  <p>It may not be straightforward, but I do think it should be possible.</p>