Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting of X-Axis is incorrect when "Split Series" is also enabled #25687

Closed
willphillips-armedia opened this issue Nov 14, 2018 · 2 comments
Closed
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available) Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@willphillips-armedia
Copy link

Kibana version: 6.4.2

Elasticsearch version: 6.4.2

Server OS version: Windows 10 17134.345 / CentOS 6 / CentOS 7

Browser version: Internet Explorer 11.345.17134.0 / Microsoft Edge 42.17134.1.0 / Mozilla Firefox 63.0.1

Browser OS version: Windows 10 17134.345

Original install method (e.g. download page, yum, from source, etc.): Download page

Describe the bug:
Bar chart sorting of the X-Axis is incorrect when using both "X-Axis" and "Split Series" bucket options at the same time.

Steps to reproduce:

  1. In Kibana, create a new Bar Chart Visualization. Select an index containing data you wish to visualize.
  2. In left sidebar, select "X-Axis" bucket. Select "Terms" Aggregation and select a string field from your index. Sort and size it however you wish.
  3. Click the "Apply Changes" button.
  4. X-Axis bars should be sorted in the expected order.
  5. Click "Add sub-buckets" button. Click "Split Series". Select "Terms" Aggregation and select a different string field from your index. Sort and size it however you wish.
  6. Click the "Apply Changes" button.
  7. Sometimes, data may still be ordered properly. Manipulate the amount of data through the Date Range and Query box. Typically becomes apparent when some X-Axis bars would have a zero count.

Expected behavior:

  1. X-Axis ordering of bars should be consistent with or without "Split Series" bucket.
  2. X-Axis ordering of bars should be consistent no matter how many records are retrieved or how they are bucketed.

Screenshots (if relevant):

Disabled "Split Series" bucket, correct ordering of X-Axis bars with custom aggregation sort
newkibanabugblankedprebug
Enabled "Split Series" bucket, incorrect ordering of X-Axis bars ("31-45 Days" is shifted far-right)
newkibanabugblankedpostbug

Provide logs and/or server output (if relevant):

Elasticsearch Response when "Split Series" was enabled, showing ES returned data in proper order

...
{
"3": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "???",
"doc_count": 15
}
]
},
"key": "Within 30 Days",
"doc_count": 15,
"2-orderAgg": {
"value": 2
}
},
{
"3": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "???",
"doc_count": 7
}
]
},
"key": "Within 31-45 Days",
"doc_count": 7,
"2-orderAgg": {
"value": 3
}
},
{
"3": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "???",
"doc_count": 5
}
]
},
"key": "Within 46-60 Days",
"doc_count": 5,
"2-orderAgg": {
"value": 4
}
},
...

Any additional context:
We recently upgraded our Elastic Stack installation from a 5.X version to 6.4.2 (completely clean install, no restoration of previous indexes). Back in 5.X we noticed that "Split Series" sorting of the Legend was more of a suggestion than a consistent sort. Now, while testing 6.4.2 we have found that the X-Axis is now inconsistent as well.

What's worse, though, is that Inspecting the Elasticsearch response shows the primary aggregation buckets are returned in the correct order, thus Kibana is inconsistently disrupting the order of perfectly ordered X-Axis buckets. This is a regression from 5.X.

@azasypkin azasypkin added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Nov 15, 2018
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@azasypkin azasypkin added the Feature:Visualizations Generic visualization features (in case no more specific feature label is available) label Nov 15, 2018
@timroes
Copy link
Contributor

timroes commented Dec 7, 2018

Duplicate of #17532

@timroes timroes marked this as a duplicate of #17532 Dec 7, 2018
@timroes timroes closed this as completed Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available) Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

4 participants