I'm trying to create a chart visualization which displays information from five events ordered by an ID.
The problem is that I am not able to see the lastest values when the aggregation size is less than the total.
Example 1
If we set size=8 the chart displays X-Axis values from "Sprint 7" to "Sprint 13".
The buckets are aggregated by the field "sprints.name.keyword" (String) and ordered by the field "sprints.id" (numeric). The higher is the "sprints.id" the recent it is.
There is any way to gather the 5 higher "sprints.id" and sort them ascendingly In order to have X-Axis Like: => Sprint 9 | Sprint 10 | Sprint 11 | Sprint 12 | Sprint 13 |
I might be misunderstanding the question, but would it achieve the result you are looking for if you ordered by Term on the sprints.name.keyword (instead of ordering by custom metric), and sort Ascending (or Descending)?
I think you understand correctly. If the X-Axis name follows the convention shown in the image eg: "sprint 1, sprint 2, sprint X... " the Kibana orders correctly by the sprints.name.keyword.
The problem here is that I can't guarantee the sprint name convention. Sometimes can exist as:
Sprint 1
Sprint 2
X Sprint 3
LKL Sprint 4
And the only way to order the sprints correctly is using the sprint.id, because the higher is the sprint.id the recent the sprint is.
first thanks a lot for that very clear explanation of your desired outcome and the issues. That helps us a lot providing the appropriate feedback to you.
I totally see what the problem is, and I think we unfortunately don't have a proper solution right now. To gather the data you actually want, you would need to switch the order to "Descending". That would reveal the data you would like, but unfortunately show the chart in the reverse order, since now the more recent sprints are to the left of the chart. I think for solving that properly, we would need an "Invert x-axis" feature, that will after returning the data from ES reverse the order of just the returned data. We have an issue open for that: https://github.com/elastic/kibana/issues/10962
I think there is also no viable workaround, except just having the chart from right to left, by switching to Descending order. The only workaround I currently see very specific for that data: You're visualizing sprints. Do they by any chance also have a date field attached and expectable length? In that case you could potentially create a filter with a date range from now-7d to now and thus limit down to data of the past week, and then just use Ascending sorting again (as you did right now).
I am sorry we're not having a better solution right now. Please also follow the above issue for updates on that.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.