Easy example with histogram


I'm using Elastic 7.5, I have an indice with fields :

  • site
  • pourcent_ok

site : site1, site2, site3...
pourcent_ok : 98.4, 99.5, 100, 80.2 ...

How to build a graph with :

  • on axis X : the sites
  • on axis Y : the pourcent_ok value

And I would like to visualize the top 3 low values.

I don't understand the meaning of aggregations, metrics, buckets...

Hi @icirco,

When you visualize, say using a "Vertical Bar" visualization, you need to create groupings (obtained from the aggregation) in order to get the values needed to generate the visualization.

So let's assume you want to create a vertical bar chart with the bars representing the site which goes on the X-axis. Here you need to create a bucket aggregation on the site field, and this will create the groupings, look at the example below using similar sample data as yours.

the data:

the visualization:

That's not all. After defining this grouping based on site, you can then apply a metric aggregation on top of each of these groups (i.e., bars). I selected Max aggregation applied to the percent field -- this will render the values that will be used for the Y-axis. Since we only have one value for each corresponding site, the max value of that (which is the same value returned) will be used to represent the quantity (height) of each bar for each site.

Take a look at your definitive guide to find out more about Aggregations (strongly recommended!): https://www.elastic.co/guide/en/elasticsearch/guide/current/aggregations.html

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