Open celevra opened 8 years ago
In addition to terms aggregation, try to add a date histogram with your timestamp field.
It would be nice, if this could be documented in the plugins readme ;)
@dwerder I believe that this is a Grafana thing and not just a Pie Chart issue. I've been working on dashboards recently and came across the same problem with the built-in Graph panel.
It seems that the date histogram aggregation does allow the piechart to show information but this information is not accurate. The problem is that the piechart will take the last entry of the date histogram and display that single bucket as the pie chart. For example, the query inspector shows the following as an answer from elasticsearch: Pie chart takes the last entry of the date buckets as the count for the key LTE, so the number if takes is 76, when the correct number is 154 matching documents.
@olivoarroba I've got the same problem but after browsing the code I found the reason.
The default "valueName" is "current" for the Pie Chart. So it only uses the "doc_count" from the last "bucket".
You can easily change this behavior by editing the Pie Chart in Grafana. Goto the Options tab and under General you can select "total" for the "value". This is the sum of all "doc_count"s from all buckets and gives you the wanted result.
Thanks @miez you are correct. By changing the value to "total" will do the trick.
Hi,
should this plugin work with elasticsearch? it seems like it doesn't like elasticsearch. this is my query:
is there something i can provide to dig deeper into the problem?
regards