Multiple Re-order for chart

Hi all,

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".

Example 2
If we set size=5 the chart displays X-Axis values from "Sprint 7" to "Sprint 11".

Metrics settings:
The Y-Axis values are an average of the fields sprints.completedUnits and sprints.estimatedUnits of type Numeric.

Bucket Aggregation Settings:

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 |

Thank you in advance.

@lukeelmers can you please grab this question?

Thanks,
Bhavya

Hey @nunodio,

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)?

Hello @lukeelmers.

Thank you for your reply!

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.

Thank you.

Thanks for clarifying. So with size=5 you are looking to display the last results in the x-axis while ordering ascending, rather than the first?

I'm not certain if there's a good way to do this -- @timroes may be able to provide some more insight here.

Hi Nuno,

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. :+1:

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.

Cheers,
Tim

2 Likes

Hi @timroes,

Thank you very much for you reply and attention.

I started to follow the referred issue to keep me posted on about this improvement.

Best regards,
Nuno

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.