我想做一个这样的图表:
所以我想在同一个条形图上显示两个字段“rest_of_the_world”和“china”。 Y轴应该是包含X值(计数)的文档编号。
例如,我有150个文件在“rest_of_the_world”字段中有“1996”,而在“中国”字段中有15个文档有“1996”。
有可能用Kibana做这样的图表吗?是否可以绘制两者之间的差异?
答案 0 :(得分:0)
这是一个古老的问题,但是我正在寻找教程或类似的图表。这是您要做的:
-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
就是这样!