Skip to content

[Heapmap] using histogram, sort by value not key #34505

@Leaf-Lin

Description

@Leaf-Lin

Describe the feature:
In the following xy data, I have all the data to be the same value (4 in this case), just x and y at various places.
Using heapmap, I can plot x y chart with buckets to be histogram field x and y.
Screen Shot 2019-04-04 at 9 24 24 am

As can be seen from the image, x-axis are all sorted by its key, but y-axis are not sorted.
I guess it's sorted by value, in which case, all the value are the same, so the order turns out to be random.

Is it possible to add options to sort by key?

This is the request body:

{
  "aggs": {
    "2": {
      "histogram": {
        "field": "x",
        "interval": 2,
        "min_doc_count": 1
      },
      "aggs": {
        "3": {
          "histogram": {
            "field": "y",
            "interval": 5,
            "min_doc_count": 1
          },
          "aggs": {
            "1": {
              "min": {
                "field": "data"
              }
            }
          }
        }
      }
    }
  },
  "size": 0,
  "_source": {
    "excludes": []
  },
  "stored_fields": [
    "*"
  ],
  "script_fields": {},
  "docvalue_fields": [],
  "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "query": "data:\"4\"",
            "analyze_wildcard": true,
            "default_field": "*"
          }
        }
      ],
      "filter": [],
      "should": [],
      "must_not": []
    }
  }
}

I've played with advanced options to add JSON input with sort to no avail.

Describe a specific use case for the feature:

It would be useful to plot xy charts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature:HeatmapHeatmap visualizationFeature:LensTeam:VisualizationsTeam label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t//enhancementNew value added to drive a business resultimpact:highAddressing this issue will have a high level of impact on the quality/strength of our product.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions