我想做一个这样的图表:
所以我想在同一个条形图上显示两个字段“rest_of_the_world”和“china”。 Y轴应该是包含X值(计数)的文档的数量。
因此,例如,我有150份文件在“rest_of_the_world”字段中有“1996”,“15”文件在“中国”字段中有“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
就是这样!