Kibana 简明教程

Kibana - Working With Graphs

在本章中,我们将讨论可视化中使用的两种类型的图表——

In this chapter, we will discuss the two types of graphs used in visualization −

  1. Line Graph

  2. Area

Line Graph

首先,让我们创建一个可视化,选择一条折线图来显示数据并使用 contriesdata 作为索引。我们需要创建 Y 轴和 X 轴,详细信息如下所示——

To start with, let us create a visualization, choosing a line graph to display the data and use contriesdata as the index. We need to create the Y -axis and X-axis and the details for the same are shown below −

For Y-axis

line graph y axis

请注意,我们已采用 Max 作为聚合。因此,这里我们将展示折线图中的数据呈现。现在,我们将绘制图表,展示国家/地区的最高人口。我们选取的字段为人口,因为我们需要按国家/地区划分最大值人口。

Observe that we have taken Max as the Aggregation. So here we are going to show data presentation in line graph. Now,we will plot graph that will show the max population country wise. The field we have taken is Population since we need maximum population country wise.

For X-axis

line graph x axis

在 x 轴上,我们已采用术语作为聚合、Country.keyword 作为字段和指标:Max Population for Order By,顺序大小为 5。因此,它将绘制人口最多的 5 个国家/地区。应用更改后,您可以看到折线图,如下所示——

On x-axis we have taken Terms as Aggregation, Country.keyword as Field and metric:Max Population for Order By, and order size is 5. So it will plot the 5 top countries with max population. After applying the changes, you can see the line graph as shown below −

line graph changes

因此,我们拥有中国人均最多的国家,其次是印度、美国、印度尼西亚和巴西这 5 个人均最多的国家。

So we have Max population in China, followed by India, United States, Indonesia and Brazil as the top 5 countries in population.

现在,让我们保存此折线图,以便稍后在仪表板中使用。

Now, let us save this line graph so that we can use in dashboard later.

save line graph

单击“确认保存”,您便可以保存可视化。

Click Confirm Save and you can save the visualization.

Area Graph

转到可视化并选择以 countriesdata 为索引的区域。我们需要选择 Y 轴和 X 轴。我们将绘制国家/地区的最大面积的面积图。

Go to visualization and choose area with index as countriesdata. We need to select the Y-axis and X-axis. We will plot area graph for max area for country wise.

因此,这里 X 轴和 Y 轴如下所示 −

So here the X- axis and Y-axis will be as shown below −

area graph
area graph axis

单击应用更改按钮后,我们可以看到输出,如下所示 −

After you click the apply changes button, the output that we can see is as shown below −

area graph changes

从该图表中,我们可以看到俄罗斯的面积最大,其次是加拿大、美国、中国和巴西。保存该可视化以供以后使用。

From the graph, we can observe that Russia has the highest area, followed by Canada, United States , China and Brazil. Save the visualization to use it later.