Skip to content

[Lens] Multi-dimensional Legend - separate visually #3402

@skearns64

Description

@skearns64

When creating a multi-dimentional visualization (e.g. Pie chart based on multiple levels of aggs), the legend can sometimes get unwieldy, as the values from both levels of aggregation are combined into a single list.
It would be nice to have the values separated into levels that correspond with the level of the Aggs. I could imagine going in two directions - one where the 2nd level is listed per first-level, and one where the values were simply grouped by level.

Example:
Data: Crime Data about car thefts, containing brand, model, color, etc.
Query: Terms aggregation - top 2 brands (by count of thefts), sub-aggregation: Terms Agg - top 3 models by count of thefts.

Legend Output today (made-up data!):
Ford and Chevrolet are brands that come from the top-level aggregation, while the rest are models that come from the

Ford 
F150
Chevrolet
Taurus
Corvette
Malibu
Fusion
Volt

Possibility 1

Level 1: 
  Chevrolet
  Ford
Level 2:
  F150
  Taurus
  Corvette
  Malibu
  Fusion
  Volt

Possibility 2 (could result in duplication of values, depending on the data)

Chevrolet
  Corvette
  Malibu
  Bolt
Ford
  F150
  Taurus
  Fusion

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature:LensFeature:VisualizationsGeneric visualization features (in case no more specific feature label is available)Team:VisualizationsTeam label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t//release_note:enhancement

    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