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

X-axis order in Line chart gets messed up after adding sub-bucket aggregation #22231

Closed
milanage opened this issue Aug 21, 2018 · 1 comment
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

@milanage
Copy link

Kibana version: 6.3.x

Elasticsearch version: 6.3.x

Server OS version:

Browser version: FireFox 61.0.1

Browser OS version:

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

Describe the bug:

Adding a terms aggregation sub-bucket (by split series) in a Line chart seems to break the original orderBy of X-axis.

See screenshot 1 where Y-axis is the count metrics, X-axis (score-rank) is ordered by desc. And it's working:

[screenshot 1]
pic1

However, after adding a terms aggregration sub-bucket (with "literature.keyword" as shown in the screenshot), the order doesn't work any more:

[screenshot 2]
pic2

Expected behavior:
X-axis order should keep the same.

Any additional context:
Elasticsearch response from inspector shows the buckets in ascending order:

Elasticsearch response body

{
  "took": 5,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 37,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "2": {
      "doc_count_error_upper_bound": 0,
      "sum_other_doc_count": 0,
      "buckets": [
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "文献1",
                "doc_count": 8
              },
              {
                "key": "文献3",
                "doc_count": 11
              },
              {
                "key": "文献5",
                "doc_count": 2
              }
            ]
          },
          "key": 1,
          "doc_count": 21
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "文献1",
                "doc_count": 3
              },
              {
                "key": "文献4",
                "doc_count": 1
              }
            ]
          },
          "key": 2,
          "doc_count": 4
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "文献1",
                "doc_count": 1
              },
              {
                "key": "文献2",
                "doc_count": 2
              }
            ]
          },
          "key": 3,
          "doc_count": 3
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "文献1",
                "doc_count": 3
              }
            ]
          },
          "key": 4,
          "doc_count": 3
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "文献4",
                "doc_count": 1
              }
            ]
          },
          "key": 5,
          "doc_count": 1
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "文献3",
                "doc_count": 1
              }
            ]
          },
          "key": 7,
          "doc_count": 1
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "文献3",
                "doc_count": 3
              }
            ]
          },
          "key": 8,
          "doc_count": 3
        }
      ]
    }
  },
  "status": 200
}
@lukasolson lukasolson added Feature:Visualizations Generic visualization features (in case no more specific feature label is available) triage_needed labels Aug 21, 2018
@timroes
Copy link
Contributor

timroes commented Sep 10, 2018

Duplicate of #17532

@timroes timroes marked this as a duplicate of #17532 Sep 10, 2018
@timroes timroes closed this as completed Sep 10, 2018
@timroes timroes added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Sep 13, 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