gpt4 book ai didi

elasticsearch - 使用Kibana在同一条形图上显示两个字段

转载 作者:行者123 更新时间:2023-12-02 22:29:43 26 4
gpt4 key购买 nike

我想做一个像这样的图表:

The chart I want to generate

因此,我有两个字段“rest_of_the_world”和“china”要显示在同一条形图上。 Y轴应该是包含X值(计数)的文档数。

例如,我有150个文档在“rest_of_the_world”字段中具有“1996”,而“15个文档在“china”字段中具有“1996”。

可以使用Kibana制作这样的图表吗?并有可能绘制两者之间的差异吗?

最佳答案

这是一个古老的问题,但是我正在寻找教程或某种东西来绘制这种图表。这是您必须做的:

-Go to [Visualize] menu, then click on the [ + ] button to add a [Vertical bar] chart
-Choose your index
-On the Metrics panel expand the [Y-Axis] options (witch selected type should be Count)
-Change the [Aggregation] to Sum
-In [Field] choose the index field/column representing the number of documents

-On the Buckets panel expand [X-Axis] options
-Put on [Aggregation] the field/colum representing the year
(or, if there are many records with date choose {Date histogram}, select the
field with that date and choose {Yearly} in the [Interval])

-Then click on the [Add sub-buckets] button on the bottom of Buckets panel
-On [Sub Aggregations] choose Terms
-On [Field] choose the field/column representing the place of document

就是这样!

关于elasticsearch - 使用Kibana在同一条形图上显示两个字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46049048/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com