English 中文(简体)
Elasticsearch - Area and Bar Charts
  • 时间:2024-11-03

Elasticsearch - Area and Bar Charts


Previous Page Next Page  

An area chart is an extension of pne chart where the area between the pne chart and the axes is highpghted with some colours. A bar chart represents data organized into a range of values and then plotted against the axes. It can consist of either horizontal bars or vertical bars.

In this chapter we will see all these three types of graphs that is created using Kibana. As discussed in earper chapters we will continue to use the data in the ecommerce index.

Area Chart

In Kibana Home screen, we find the option name Visuapze which allows us to create visuapzation and aggregations from the indices stored in Elasticsearch. We choose to add a new visuapzation and select Area Chart as the option shown in the image given below.

Area Chart Visuapze

Choose the Metrics

The next screen prompts us for choosing the metrics which will be used in creating the Area Chart. Here we choose the sum as the type of aggregation metric. Then we choose total_quantity field as the field to be used as metric. On the X-axis, we chose the order_date field and sppt the series with the given metric in a size of 5.

Area Chart Metrics

On running the above configuration, we get the following area chart as the output −

Area Chart Output

Horizontal Bar Chart

Similarly, for the Horizontal bar chart we choose new visuapzation from Kibana Home screen and choose the option for Horizontal Bar. Then we choose the metrics as shown in the image below. Here we choose Sum as the aggregation for the filed named product quantity. Then we choose buckets with date histogram for the field order date.

Horizontal Bar Chart

On running the above configuration, we can see a horizontal bar chart as shown below −

Configuration of Horizontal Bar Chart

Vertical Bar Chart

For the vertical bar chart, we choose new visuapzation from Kibana Home screen and choose the option for Vertical Bar. Then we choose the metrics as shown in the image below.

Here we choose Sum as the aggregation for the field named product quantity. Then we choose buckets with date histogram for the field order date with a weekly interval.

Vertical Bar Chart

On running the above configuration, a chart will be generated as shown below −

Configuration of Vertical Bar Chart Advertisements