Elasticsearch 简明教程

Elasticsearch - Pie Charts

饼图是最简单、最著名的可视化工具之一。它将数据表示为不同颜色的圆圈切片。可以将标签与百分比数据值一起显示在圆圈内。圆圈也可以变成甜甜圈的形状。

Pie charts are one of the simplest and famous visualization tools. It represents the data as slices of a circle each coloured differently. The labels along with the percentage data values can be presented along with the circle. The circle can also take the shape of a donut.

Visualize

在 Kibana 主屏幕中,我们找到可视化选项名称,该选项允许我们从 Elasticsearch 中存储的索引创建可视化和聚合。我们选择添加一个新的可视化,并选择如下所示的选项,即饼图。

In Kibana Home screen, we find the option name Visualize which allows us to create visualization and aggregations from the indices stored in Elasticsearch. We choose to add a new visualization and select pie chart as the option shown below.

pie charts visualize

Choose the Metrics

下一个屏幕提示我们选择用于创建饼图的度量标准。在这里,我们选择基准价格计数作为度量标准,并将存储桶聚合选择为直方图。另外,将最小间隔选择为 20。因此,价格将以 20 为范围的值块显示。

The next screen prompts us for choosing the metrics which will be used in creating the Pie Chart. Here we choose the count of base unit price as the metric and Bucket Aggregation as histogram. Also, the minimum interval is chosen as 20. So, the prices will be displayed as blocks of values with 20 as a range.

pie charts metrics

在应用选择后,以下结果显示饼状图。请注意标签中提到的颜色阴影及其值。

The result below shows the pie chart after we apply the selection. Please note the shades of the colour and their values mentioned in the label.

pie charts

Pie Chart Options

移动到饼状图下的选项选项卡上,我们可以看到各种配置选项,以更改饼状图中数据的显示外观和排列。在以下示例中,饼状图显示为甜甜圈状,且标签显示在顶部。

On moving to the options tab under pie chart we can see various configuration options to change the look as well as the arrangement of data display in the pie chart. In the following example, the pie chart appears as donut and the labels appear at the top.

pie charts options