Skip to content

Treemap Chart Panel Configuration

The Treemap chart panel visualizes hierarchical data as nested rectangles, where each rectangle's size represents a metric value. Treemap charts support exactly one metric and require at least one breakdown (maximum two breakdowns).


Lens Treemap Charts

Represents a Treemap chart configuration within a Lens panel.

Attributes:

Name Type Description
data_view str

The data view that determines the data for the treemap chart.

metric LensDataMetricTypes

Metric that determines the rectangle sizes. Treemap supports only one metric.

breakdowns list[LensBreakdownTypes]

Breakdowns that determine treemap grouping levels. Maximum 2 breakdowns supported.

Show JSON schema:
{
  "$defs": {
    "CollapseAggregationEnum": {
      "description": "The aggregation to use for the dimension.",
      "enum": [
        "sum",
        "min",
        "max",
        "avg"
      ],
      "title": "CollapseAggregationEnum",
      "type": "string"
    },
    "ColorValueAssignment": {
      "additionalProperties": false,
      "description": "Manual color assignment to specific categorical values.",
      "properties": {
        "value": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A single category value to assign a color to.",
          "title": "Value"
        },
        "values": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Multiple category values to assign the same color to.",
          "title": "Values"
        },
        "color": {
          "description": "The hex color code to assign (e.g., '#FF0000').",
          "title": "Color",
          "type": "string"
        }
      },
      "required": [
        "color"
      ],
      "title": "ColorValueAssignment",
      "type": "object"
    },
    "ColorValueMapping": {
      "additionalProperties": false,
      "description": "Categorical color mapping for charts keyed by exact values.",
      "properties": {
        "palette": {
          "default": "eui_amsterdam_color_blind",
          "description": "The palette ID to use for unassigned colors.\n\nAvailable palettes:\n- 'default' - Standard EUI palette\n- 'eui_amsterdam_color_blind' - Color-blind safe palette (default)\n- 'kibana_palette' or 'legacy' - Legacy Kibana colors\n- 'elastic_brand' - Elastic brand colors\n- 'gray' - Grayscale palette",
          "title": "Palette",
          "type": "string"
        },
        "assignments": {
          "description": "Manual color assignments to specific data values.",
          "items": {
            "$ref": "#/$defs/ColorValueAssignment"
          },
          "title": "Assignments",
          "type": "array"
        }
      },
      "title": "ColorValueMapping",
      "type": "object"
    },
    "KqlQuery": {
      "additionalProperties": false,
      "description": "Represents a KQL (Kibana Query Language) query configuration.\n\nKQL is the default query language in Kibana and provides a simplified syntax for filtering data.",
      "properties": {
        "kql": {
          "description": "The Kibana Query Language (KQL) query string to apply.",
          "title": "Kql",
          "type": "string"
        }
      },
      "required": [
        "kql"
      ],
      "title": "KqlQuery",
      "type": "object"
    },
    "LegacyQueryTypes": {
      "oneOf": [
        {
          "$ref": "#/$defs/KqlQuery"
        },
        {
          "$ref": "#/$defs/LuceneQuery"
        }
      ]
    },
    "LegendVisibleEnum": {
      "description": "Represents the possible values for the visibility of the legend in a pie chart.",
      "enum": [
        "show",
        "hide",
        "auto"
      ],
      "title": "LegendVisibleEnum",
      "type": "string"
    },
    "LegendWidthEnum": {
      "description": "Represents the possible values for the width/size of the legend.",
      "enum": [
        "small",
        "medium",
        "large",
        "extra_large"
      ],
      "title": "LegendWidthEnum",
      "type": "string"
    },
    "LensAggregatedMetricTypes": {
      "anyOf": [
        {
          "$ref": "#/$defs/LensOtherAggregatedMetric"
        },
        {
          "$ref": "#/$defs/LensLastValueAggregatedMetric"
        },
        {
          "$ref": "#/$defs/LensCountAggregatedMetric"
        },
        {
          "$ref": "#/$defs/LensSumAggregatedMetric"
        },
        {
          "$ref": "#/$defs/LensPercentileRankAggregatedMetric"
        },
        {
          "$ref": "#/$defs/LensPercentileAggregatedMetric"
        }
      ]
    },
    "LensBreakdownTypes": {
      "anyOf": [
        {
          "$ref": "#/$defs/LensTermsBreakdown"
        },
        {
          "$ref": "#/$defs/LensMultiTermsBreakdown"
        },
        {
          "$ref": "#/$defs/LensDateHistogramBreakdown"
        },
        {
          "$ref": "#/$defs/LensFiltersBreakdown"
        },
        {
          "$ref": "#/$defs/LensIntervalsBreakdown"
        }
      ]
    },
    "LensCountAggregatedMetric": {
      "additionalProperties": false,
      "description": "Represents a count metric configuration within a Lens chart.\n\nCount metrics are used to count the number of documents in a data view.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A unique identifier. If not provided, one will be generated automatically.",
          "title": "Id"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display label for the metric. If not provided, a label may be inferred from the type and field.",
          "title": "Label"
        },
        "format": {
          "anyOf": [
            {
              "$ref": "#/$defs/LensMetricFormatTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The format of the metric."
        },
        "filter": {
          "anyOf": [
            {
              "$ref": "#/$defs/LegacyQueryTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A KQL filter applied before determining the metric value."
        },
        "aggregation": {
          "default": "count",
          "enum": [
            "count",
            "unique_count"
          ],
          "title": "Aggregation",
          "type": "string"
        },
        "field": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The field to count. If not provided, the count will be of all documents in the data view.",
          "title": "Field"
        },
        "exclude_zeros": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to exclude zero values from the count. Kibana defaults to true if not specified.",
          "title": "Exclude Zeros"
        }
      },
      "title": "LensCountAggregatedMetric",
      "type": "object"
    },
    "LensCustomMetricFormat": {
      "additionalProperties": false,
      "description": "Custom format configuration for metrics using numeral.js patterns.\n\nUse this for complete control over numeric formatting with numeral.js syntax.",
      "properties": {
        "type": {
          "const": "custom",
          "default": "custom",
          "description": "Format type identifier. Must be 'custom' for custom formats.",
          "title": "Type",
          "type": "string"
        },
        "decimals": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The number of decimal places to display. If not specified, defaults to 0.",
          "title": "Decimals"
        },
        "pattern": {
          "description": "numeral.js format pattern (e.g., \"0,0.00\" for comma-separated numbers with 2 decimals).",
          "title": "Pattern",
          "type": "string"
        },
        "suffix": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional suffix to display after the formatted number (e.g., \" requests\", \" users\").",
          "title": "Suffix"
        },
        "compact": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to use compact notation (e.g., 1.2K instead of 1200). Defaults to Kibana's behavior.",
          "title": "Compact"
        }
      },
      "required": [
        "pattern"
      ],
      "title": "LensCustomMetricFormat",
      "type": "object"
    },
    "LensDataMetricTypes": {
      "anyOf": [
        {
          "$ref": "#/$defs/LensFormulaMetric"
        },
        {
          "$ref": "#/$defs/LensAggregatedMetricTypes"
        }
      ]
    },
    "LensDateHistogramBreakdown": {
      "additionalProperties": false,
      "description": "Date histogram breakdown with optional collapse aggregation.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A unique identifier. If not provided, one will be generated automatically.",
          "title": "Id"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display label for the dimension. If not provided, a label may be inferred from the field and type.",
          "title": "Label"
        },
        "type": {
          "const": "date_histogram",
          "default": "date_histogram",
          "title": "Type",
          "type": "string"
        },
        "field": {
          "description": "The name of the field in the data view that this dimension is based on.",
          "title": "Field",
          "type": "string"
        },
        "minimum_interval": {
          "anyOf": [
            {
              "$ref": "#/$defs/LensDateMathMinimumInterval"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The minimum interval using Elasticsearch date math format (e.g. `1m`, `1h`). Defaults to `auto`."
        },
        "partial_intervals": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "If `true`, show partial intervals. Kibana defaults to `true` if not specified.",
          "title": "Partial Intervals"
        },
        "collapse": {
          "anyOf": [
            {
              "$ref": "#/$defs/CollapseAggregationEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Aggregate all breakdown values into a single bucket using this function (sum, avg, min, max)."
        }
      },
      "required": [
        "field"
      ],
      "title": "LensDateHistogramBreakdown",
      "type": "object"
    },
    "LensDateMathMinimumInterval": {
      "anyOf": [
        {
          "const": "auto",
          "type": "string"
        },
        {
          "pattern": "^[1-9][0-9]*(ms|s|m|h|d|w|M|q|y)$",
          "type": "string"
        }
      ]
    },
    "LensFiltersBreakdown": {
      "additionalProperties": false,
      "description": "Filters breakdown with optional collapse aggregation.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A unique identifier. If not provided, one will be generated automatically.",
          "title": "Id"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display label for the dimension. If not provided, a label may be inferred from the field and type.",
          "title": "Label"
        },
        "type": {
          "const": "filters",
          "default": "filters",
          "title": "Type",
          "type": "string"
        },
        "filters": {
          "description": "The filters to use for the dimension.",
          "items": {
            "$ref": "#/$defs/LensFiltersDimensionFilter"
          },
          "title": "Filters",
          "type": "array"
        },
        "collapse": {
          "anyOf": [
            {
              "$ref": "#/$defs/CollapseAggregationEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Aggregate all breakdown values into a single bucket using this function (sum, avg, min, max)."
        }
      },
      "required": [
        "filters"
      ],
      "title": "LensFiltersBreakdown",
      "type": "object"
    },
    "LensFiltersDimensionFilter": {
      "additionalProperties": false,
      "description": "A filter for a filters dimension.",
      "properties": {
        "query": {
          "$ref": "#/$defs/LegacyQueryTypes",
          "description": "The query to use for the dimension."
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display label for the filter. If not provided, the query will be used as the label.",
          "title": "Label"
        }
      },
      "required": [
        "query"
      ],
      "title": "LensFiltersDimensionFilter",
      "type": "object"
    },
    "LensFormulaMetric": {
      "additionalProperties": false,
      "description": "Represents a formula metric configuration within a Lens chart.\n\nFormula metrics allow for custom calculations using Kibana's formula syntax.\nThe formula string is passed directly to Kibana, which handles parsing and\nAST generation internally.\n\nExample formulas:\n- Simple arithmetic: \"count() / 100\"\n- Field aggregations: \"(max(response.time) - min(response.time)) / average(response.time)\"\n- With filters: \"count(kql='status:error') / count() * 100\"",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A unique identifier. If not provided, one will be generated automatically.",
          "title": "Id"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display label for the metric. If not provided, a label may be inferred from the type and field.",
          "title": "Label"
        },
        "format": {
          "anyOf": [
            {
              "$ref": "#/$defs/LensMetricFormatTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The format of the metric."
        },
        "filter": {
          "anyOf": [
            {
              "$ref": "#/$defs/LegacyQueryTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A KQL filter applied before determining the metric value."
        },
        "formula": {
          "description": "The formula string to be evaluated for this metric.",
          "title": "Formula",
          "type": "string"
        }
      },
      "required": [
        "formula"
      ],
      "title": "LensFormulaMetric",
      "type": "object"
    },
    "LensIntervalsBreakdown": {
      "additionalProperties": false,
      "description": "Intervals breakdown with optional collapse aggregation.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A unique identifier. If not provided, one will be generated automatically.",
          "title": "Id"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display label for the dimension. If not provided, a label may be inferred from the field and type.",
          "title": "Label"
        },
        "type": {
          "const": "intervals",
          "default": "intervals",
          "title": "Type",
          "type": "string"
        },
        "field": {
          "description": "The name of the field in the data view that this dimension is based on.",
          "title": "Field",
          "type": "string"
        },
        "intervals": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/LensIntervalsDimensionInterval"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The intervals to use for the dimension. If not provided, intervals will be automatically picked.",
          "title": "Intervals"
        },
        "granularity": {
          "anyOf": [
            {
              "maximum": 7,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Interval granularity divides the field into evenly spaced intervals based on the minimum and maximum values for the field.\nKibana defaults to 4 if not specified.",
          "title": "Granularity"
        },
        "include_empty_intervals": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "If `true`, include empty histogram buckets. Defaults to `true`.",
          "title": "Include Empty Intervals"
        },
        "collapse": {
          "anyOf": [
            {
              "$ref": "#/$defs/CollapseAggregationEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Aggregate all breakdown values into a single bucket using this function (sum, avg, min, max)."
        }
      },
      "required": [
        "field"
      ],
      "title": "LensIntervalsBreakdown",
      "type": "object"
    },
    "LensIntervalsDimensionInterval": {
      "additionalProperties": false,
      "description": "A single interval for an intervals dimension.",
      "properties": {
        "from": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The start of the interval.",
          "title": "From"
        },
        "to": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The end of the interval.",
          "title": "To"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The label for the interval.",
          "title": "Label"
        }
      },
      "title": "LensIntervalsDimensionInterval",
      "type": "object"
    },
    "LensLastValueAggregatedMetric": {
      "additionalProperties": false,
      "description": "Represents a last value metric configuration within a Lens chart.\n\nLast value metrics are used to retrieve the most recent value of a field based on a specified sort order.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A unique identifier. If not provided, one will be generated automatically.",
          "title": "Id"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display label for the metric. If not provided, a label may be inferred from the type and field.",
          "title": "Label"
        },
        "format": {
          "anyOf": [
            {
              "$ref": "#/$defs/LensMetricFormatTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The format of the metric."
        },
        "filter": {
          "anyOf": [
            {
              "$ref": "#/$defs/LegacyQueryTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A KQL filter applied before determining the metric value."
        },
        "aggregation": {
          "const": "last_value",
          "default": "last_value",
          "title": "Aggregation",
          "type": "string"
        },
        "field": {
          "title": "Field",
          "type": "string"
        },
        "date_field": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The field used to determine the 'last' value.",
          "title": "Date Field"
        }
      },
      "required": [
        "field"
      ],
      "title": "LensLastValueAggregatedMetric",
      "type": "object"
    },
    "LensMetricFormat": {
      "additionalProperties": false,
      "description": "Standard format configuration for displaying metric values.\n\nSupports common numeric formats with optional suffix and compact notation.",
      "properties": {
        "type": {
          "description": "The format type for the metric value.\n\nAvailable formats:\n- **number**: Plain numeric value with optional decimal places\n- **bytes**: Byte size formatting (B, KB, MB, GB, TB)\n- **bits**: Bit size formatting (b, Kb, Mb, Gb, Tb)\n- **percent**: Percentage formatting with % symbol\n- **duration**: Time duration formatting (ms, s, m, h, d)",
          "enum": [
            "number",
            "bytes",
            "bits",
            "percent",
            "duration"
          ],
          "title": "Type",
          "type": "string"
        },
        "decimals": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The number of decimal places to display. If not specified, defaults to 2 for number/bytes/percent, 0 for bits/duration.",
          "title": "Decimals"
        },
        "suffix": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional suffix to display after the formatted number (e.g., \" requests\", \" users\").",
          "title": "Suffix"
        },
        "compact": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to use compact notation (e.g., 1.2K instead of 1200). Defaults to Kibana's behavior.",
          "title": "Compact"
        }
      },
      "required": [
        "type"
      ],
      "title": "LensMetricFormat",
      "type": "object"
    },
    "LensMetricFormatTypes": {
      "anyOf": [
        {
          "$ref": "#/$defs/LensMetricFormat"
        },
        {
          "$ref": "#/$defs/LensCustomMetricFormat"
        }
      ]
    },
    "LensMultiTermsBreakdown": {
      "additionalProperties": false,
      "description": "Multi-field top-values breakdown with optional collapse aggregation.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A unique identifier. If not provided, one will be generated automatically.",
          "title": "Id"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display label for the dimension. If not provided, a label may be inferred from the field and type.",
          "title": "Label"
        },
        "type": {
          "const": "values",
          "default": "values",
          "title": "Type",
          "type": "string"
        },
        "size": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The number of top terms to display.",
          "title": "Size"
        },
        "sort": {
          "anyOf": [
            {
              "$ref": "#/$defs/Sort"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The sort configuration for the terms."
        },
        "show_other_bucket": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "If `true`, show a bucket for terms not included in the top size. Defaults to `true`.",
          "title": "Show Other Bucket"
        },
        "include_missing_values": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "If `true`, show a bucket for documents with a missing value for the field. Defaults to `false`.",
          "title": "Include Missing Values"
        },
        "include": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A list of terms to include. Can be used with or without `include_is_regex`.",
          "title": "Include"
        },
        "exclude": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A list of terms to exclude. Can be used with or without `exclude_is_regex`.",
          "title": "Exclude"
        },
        "include_is_regex": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "If `true`, treat the values in the `include` list as regular expressions. Defaults to `false`.",
          "title": "Include Is Regex"
        },
        "exclude_is_regex": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "If `true`, treat the values in the `exclude` list as regular expressions. Defaults to `false`.",
          "title": "Exclude Is Regex"
        },
        "fields": {
          "description": "List of field names for multi-field aggregation. Requires at least 2 fields.",
          "items": {
            "type": "string"
          },
          "minItems": 2,
          "title": "Fields",
          "type": "array"
        },
        "collapse": {
          "anyOf": [
            {
              "$ref": "#/$defs/CollapseAggregationEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Aggregate all breakdown values into a single bucket using this function (sum, avg, min, max)."
        }
      },
      "required": [
        "fields"
      ],
      "title": "LensMultiTermsBreakdown",
      "type": "object"
    },
    "LensOtherAggregatedMetric": {
      "additionalProperties": false,
      "description": "Represents various aggregated metric configurations within a Lens chart.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A unique identifier. If not provided, one will be generated automatically.",
          "title": "Id"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display label for the metric. If not provided, a label may be inferred from the type and field.",
          "title": "Label"
        },
        "format": {
          "anyOf": [
            {
              "$ref": "#/$defs/LensMetricFormatTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The format of the metric."
        },
        "filter": {
          "anyOf": [
            {
              "$ref": "#/$defs/LegacyQueryTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A KQL filter applied before determining the metric value."
        },
        "aggregation": {
          "description": "The aggregation type for the metric (e.g., 'min', 'max', 'median', 'average', 'standard_deviation').",
          "enum": [
            "min",
            "max",
            "median",
            "average",
            "standard_deviation"
          ],
          "title": "Aggregation",
          "type": "string"
        },
        "field": {
          "title": "Field",
          "type": "string"
        }
      },
      "required": [
        "aggregation",
        "field"
      ],
      "title": "LensOtherAggregatedMetric",
      "type": "object"
    },
    "LensPercentileAggregatedMetric": {
      "additionalProperties": false,
      "description": "Represents a percentile metric configuration within a Lens chart.\n\nPercentile metrics are used to determine the value at a specific percentile in a data set.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A unique identifier. If not provided, one will be generated automatically.",
          "title": "Id"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display label for the metric. If not provided, a label may be inferred from the type and field.",
          "title": "Label"
        },
        "format": {
          "anyOf": [
            {
              "$ref": "#/$defs/LensMetricFormatTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The format of the metric."
        },
        "filter": {
          "anyOf": [
            {
              "$ref": "#/$defs/LegacyQueryTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A KQL filter applied before determining the metric value."
        },
        "aggregation": {
          "const": "percentile",
          "default": "percentile",
          "title": "Aggregation",
          "type": "string"
        },
        "field": {
          "title": "Field",
          "type": "string"
        },
        "percentile": {
          "title": "Percentile",
          "type": "integer"
        }
      },
      "required": [
        "field",
        "percentile"
      ],
      "title": "LensPercentileAggregatedMetric",
      "type": "object"
    },
    "LensPercentileRankAggregatedMetric": {
      "additionalProperties": false,
      "description": "Represents a percentile rank metric configuration within a Lens chart.\n\nPercentile rank metrics are used to determine the rank of a value in a data set.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A unique identifier. If not provided, one will be generated automatically.",
          "title": "Id"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display label for the metric. If not provided, a label may be inferred from the type and field.",
          "title": "Label"
        },
        "format": {
          "anyOf": [
            {
              "$ref": "#/$defs/LensMetricFormatTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The format of the metric."
        },
        "filter": {
          "anyOf": [
            {
              "$ref": "#/$defs/LegacyQueryTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A KQL filter applied before determining the metric value."
        },
        "aggregation": {
          "const": "percentile_rank",
          "default": "percentile_rank",
          "title": "Aggregation",
          "type": "string"
        },
        "field": {
          "title": "Field",
          "type": "string"
        },
        "rank": {
          "title": "Rank",
          "type": "integer"
        }
      },
      "required": [
        "field",
        "rank"
      ],
      "title": "LensPercentileRankAggregatedMetric",
      "type": "object"
    },
    "LensSumAggregatedMetric": {
      "additionalProperties": false,
      "description": "Represents a sum metric configuration within a Lens chart.\n\nSum metrics are used to sum the values of a field.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A unique identifier. If not provided, one will be generated automatically.",
          "title": "Id"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display label for the metric. If not provided, a label may be inferred from the type and field.",
          "title": "Label"
        },
        "format": {
          "anyOf": [
            {
              "$ref": "#/$defs/LensMetricFormatTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The format of the metric."
        },
        "filter": {
          "anyOf": [
            {
              "$ref": "#/$defs/LegacyQueryTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A KQL filter applied before determining the metric value."
        },
        "aggregation": {
          "const": "sum",
          "default": "sum",
          "title": "Aggregation",
          "type": "string"
        },
        "field": {
          "title": "Field",
          "type": "string"
        },
        "exclude_zeros": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to exclude zero values from the sum. Kibana defaults to true if not specified.",
          "title": "Exclude Zeros"
        }
      },
      "required": [
        "field"
      ],
      "title": "LensSumAggregatedMetric",
      "type": "object"
    },
    "LensTermsBreakdown": {
      "additionalProperties": false,
      "description": "Top-values breakdown with optional collapse aggregation.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A unique identifier. If not provided, one will be generated automatically.",
          "title": "Id"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display label for the dimension. If not provided, a label may be inferred from the field and type.",
          "title": "Label"
        },
        "type": {
          "const": "values",
          "default": "values",
          "title": "Type",
          "type": "string"
        },
        "size": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The number of top terms to display.",
          "title": "Size"
        },
        "sort": {
          "anyOf": [
            {
              "$ref": "#/$defs/Sort"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The sort configuration for the terms."
        },
        "show_other_bucket": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "If `true`, show a bucket for terms not included in the top size. Defaults to `true`.",
          "title": "Show Other Bucket"
        },
        "include_missing_values": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "If `true`, show a bucket for documents with a missing value for the field. Defaults to `false`.",
          "title": "Include Missing Values"
        },
        "include": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A list of terms to include. Can be used with or without `include_is_regex`.",
          "title": "Include"
        },
        "exclude": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A list of terms to exclude. Can be used with or without `exclude_is_regex`.",
          "title": "Exclude"
        },
        "include_is_regex": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "If `true`, treat the values in the `include` list as regular expressions. Defaults to `false`.",
          "title": "Include Is Regex"
        },
        "exclude_is_regex": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "If `true`, treat the values in the `exclude` list as regular expressions. Defaults to `false`.",
          "title": "Exclude Is Regex"
        },
        "field": {
          "description": "The name of the field in the data view that this dimension is based on.",
          "title": "Field",
          "type": "string"
        },
        "collapse": {
          "anyOf": [
            {
              "$ref": "#/$defs/CollapseAggregationEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Aggregate all breakdown values into a single bucket using this function (sum, avg, min, max)."
        }
      },
      "required": [
        "field"
      ],
      "title": "LensTermsBreakdown",
      "type": "object"
    },
    "LuceneQuery": {
      "additionalProperties": false,
      "description": "Represents a Lucene query configuration.\n\nLucene provides a more powerful and flexible, but less friendly, syntax for querying data compared to KQL.",
      "properties": {
        "lucene": {
          "description": "The Lucene query string to apply.",
          "title": "Lucene",
          "type": "string"
        }
      },
      "required": [
        "lucene"
      ],
      "title": "LuceneQuery",
      "type": "object"
    },
    "PieSliceValuesEnum": {
      "description": "Represents the possible values for slice values in a pie chart.",
      "enum": [
        "hide",
        "integer",
        "percent"
      ],
      "title": "PieSliceValuesEnum",
      "type": "string"
    },
    "Sort": {
      "additionalProperties": false,
      "description": "Represents a sort configuration in the Config schema.",
      "properties": {
        "by": {
          "description": "The field name to sort the data by.",
          "title": "By",
          "type": "string"
        },
        "direction": {
          "description": "The sort direction. Must be either 'asc' for ascending or 'desc' for descending.",
          "enum": [
            "asc",
            "desc"
          ],
          "title": "Direction",
          "type": "string"
        }
      },
      "required": [
        "by",
        "direction"
      ],
      "title": "Sort",
      "type": "object"
    },
    "TreemapAppearance": {
      "additionalProperties": false,
      "description": "Formatting options for treemap appearance.",
      "properties": {
        "categories": {
          "anyOf": [
            {
              "$ref": "#/$defs/TreemapCategoriesConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Formatting options for category labels."
        },
        "values": {
          "anyOf": [
            {
              "$ref": "#/$defs/TreemapValuesConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Formatting options for numeric values."
        }
      },
      "title": "TreemapAppearance",
      "type": "object"
    },
    "TreemapCategoriesConfig": {
      "additionalProperties": false,
      "description": "Formatting options for category labels.",
      "properties": {
        "position": {
          "anyOf": [
            {
              "$ref": "#/$defs/TreemapSliceLabelsEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls the visibility of category labels. Defaults to show when not specified."
        }
      },
      "title": "TreemapCategoriesConfig",
      "type": "object"
    },
    "TreemapLegend": {
      "additionalProperties": false,
      "description": "Represents legend formatting options for treemap charts.",
      "properties": {
        "visible": {
          "anyOf": [
            {
              "$ref": "#/$defs/LegendVisibleEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Visibility of the legend. Kibana defaults vary by chart type."
        },
        "position": {
          "anyOf": [
            {
              "enum": [
                "top",
                "right",
                "bottom",
                "left"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Position of the legend.",
          "title": "Position"
        },
        "width": {
          "anyOf": [
            {
              "$ref": "#/$defs/LegendWidthEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Width of the legend."
        },
        "truncate_labels": {
          "anyOf": [
            {
              "maximum": 5,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Number of lines to truncate the legend labels to. Kibana defaults to 1 if not specified. Set to 0 to disable truncation.",
          "title": "Truncate Labels"
        },
        "nested": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to show legend in nested format for multi-level pie charts. Kibana defaults to False if not specified.",
          "title": "Nested"
        },
        "show_single_series": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to show legend when there is only one series. Kibana defaults to false if not specified.",
          "title": "Show Single Series"
        }
      },
      "title": "TreemapLegend",
      "type": "object"
    },
    "TreemapSliceLabelsEnum": {
      "description": "Represents the possible values for treemap slice labels.",
      "enum": [
        "hide",
        "show"
      ],
      "title": "TreemapSliceLabelsEnum",
      "type": "string"
    },
    "TreemapValuesConfig": {
      "additionalProperties": false,
      "description": "Formatting options for numeric values.",
      "properties": {
        "format": {
          "anyOf": [
            {
              "$ref": "#/$defs/PieSliceValuesEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls the display of values in treemap rectangles. Defaults to percent."
        },
        "decimal_places": {
          "anyOf": [
            {
              "maximum": 10,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls the number of decimal places for values.",
          "title": "Decimal Places"
        }
      },
      "title": "TreemapValuesConfig",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Represents a Treemap chart configuration within a Lens panel.",
  "properties": {
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A unique identifier. If not provided, one will be generated automatically.",
      "title": "Id"
    },
    "type": {
      "const": "treemap",
      "default": "treemap",
      "description": "The type of chart, which is 'treemap' for this visualization.",
      "title": "Type",
      "type": "string"
    },
    "appearance": {
      "anyOf": [
        {
          "$ref": "#/$defs/TreemapAppearance"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Formatting options for the chart appearance."
    },
    "legend": {
      "anyOf": [
        {
          "$ref": "#/$defs/TreemapLegend"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Formatting options for the chart legend."
    },
    "color": {
      "anyOf": [
        {
          "$ref": "#/$defs/ColorValueMapping"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Formatting options for the chart color."
    },
    "data_view": {
      "description": "The data view that determines the data for the treemap chart.",
      "title": "Data View",
      "type": "string"
    },
    "metric": {
      "$ref": "#/$defs/LensDataMetricTypes",
      "description": "Metric that determines the rectangle sizes. Treemap supports only one metric."
    },
    "breakdowns": {
      "description": "Breakdowns that determine treemap grouping levels. Maximum 2 breakdowns supported.",
      "items": {
        "$ref": "#/$defs/LensBreakdownTypes"
      },
      "maxItems": 2,
      "title": "Breakdowns",
      "type": "array"
    }
  },
  "required": [
    "data_view",
    "metric",
    "breakdowns"
  ],
  "title": "LensTreemapChart",
  "type": "object"
}

validate_breakdowns_count classmethod

validate_breakdowns_count(v)

Validate that treemap has at least one breakdown.

Treemap Chart Legend

For comprehensive guidance on legend configuration, see the Legend Configuration Guide.

Represents legend formatting options for treemap charts.

Show JSON schema:
{
  "$defs": {
    "LegendVisibleEnum": {
      "description": "Represents the possible values for the visibility of the legend in a pie chart.",
      "enum": [
        "show",
        "hide",
        "auto"
      ],
      "title": "LegendVisibleEnum",
      "type": "string"
    },
    "LegendWidthEnum": {
      "description": "Represents the possible values for the width/size of the legend.",
      "enum": [
        "small",
        "medium",
        "large",
        "extra_large"
      ],
      "title": "LegendWidthEnum",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "description": "Represents legend formatting options for treemap charts.",
  "properties": {
    "visible": {
      "anyOf": [
        {
          "$ref": "#/$defs/LegendVisibleEnum"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Visibility of the legend. Kibana defaults vary by chart type."
    },
    "position": {
      "anyOf": [
        {
          "enum": [
            "top",
            "right",
            "bottom",
            "left"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Position of the legend.",
      "title": "Position"
    },
    "width": {
      "anyOf": [
        {
          "$ref": "#/$defs/LegendWidthEnum"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Width of the legend."
    },
    "truncate_labels": {
      "anyOf": [
        {
          "maximum": 5,
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of lines to truncate the legend labels to. Kibana defaults to 1 if not specified. Set to 0 to disable truncation.",
      "title": "Truncate Labels"
    },
    "nested": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether to show legend in nested format for multi-level pie charts. Kibana defaults to False if not specified.",
      "title": "Nested"
    },
    "show_single_series": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether to show legend when there is only one series. Kibana defaults to false if not specified.",
      "title": "Show Single Series"
    }
  },
  "title": "TreemapLegend",
  "type": "object"
}

Treemap Chart Appearance

Formatting options for treemap appearance.

Attributes:

Name Type Description
categories TreemapCategoriesConfig | None

Formatting options for category labels.

values TreemapValuesConfig | None

Formatting options for numeric values.

Show JSON schema:
{
  "$defs": {
    "PieSliceValuesEnum": {
      "description": "Represents the possible values for slice values in a pie chart.",
      "enum": [
        "hide",
        "integer",
        "percent"
      ],
      "title": "PieSliceValuesEnum",
      "type": "string"
    },
    "TreemapCategoriesConfig": {
      "additionalProperties": false,
      "description": "Formatting options for category labels.",
      "properties": {
        "position": {
          "anyOf": [
            {
              "$ref": "#/$defs/TreemapSliceLabelsEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls the visibility of category labels. Defaults to show when not specified."
        }
      },
      "title": "TreemapCategoriesConfig",
      "type": "object"
    },
    "TreemapSliceLabelsEnum": {
      "description": "Represents the possible values for treemap slice labels.",
      "enum": [
        "hide",
        "show"
      ],
      "title": "TreemapSliceLabelsEnum",
      "type": "string"
    },
    "TreemapValuesConfig": {
      "additionalProperties": false,
      "description": "Formatting options for numeric values.",
      "properties": {
        "format": {
          "anyOf": [
            {
              "$ref": "#/$defs/PieSliceValuesEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls the display of values in treemap rectangles. Defaults to percent."
        },
        "decimal_places": {
          "anyOf": [
            {
              "maximum": 10,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls the number of decimal places for values.",
          "title": "Decimal Places"
        }
      },
      "title": "TreemapValuesConfig",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Formatting options for treemap appearance.",
  "properties": {
    "categories": {
      "anyOf": [
        {
          "$ref": "#/$defs/TreemapCategoriesConfig"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Formatting options for category labels."
    },
    "values": {
      "anyOf": [
        {
          "$ref": "#/$defs/TreemapValuesConfig"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Formatting options for numeric values."
    }
  },
  "title": "TreemapAppearance",
  "type": "object"
}

Formatting options for category labels.

Attributes:

Name Type Description
position TreemapSliceLabelsEnum | None

Controls the visibility of category labels. Defaults to show when not specified.

Show JSON schema:
{
  "$defs": {
    "TreemapSliceLabelsEnum": {
      "description": "Represents the possible values for treemap slice labels.",
      "enum": [
        "hide",
        "show"
      ],
      "title": "TreemapSliceLabelsEnum",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "description": "Formatting options for category labels.",
  "properties": {
    "position": {
      "anyOf": [
        {
          "$ref": "#/$defs/TreemapSliceLabelsEnum"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Controls the visibility of category labels. Defaults to show when not specified."
    }
  },
  "title": "TreemapCategoriesConfig",
  "type": "object"
}

Formatting options for numeric values.

Attributes:

Name Type Description
format PieSliceValuesEnum | None

Controls the display of values in treemap rectangles. Defaults to percent.

decimal_places int | None

Controls the number of decimal places for values.

Show JSON schema:
{
  "$defs": {
    "PieSliceValuesEnum": {
      "description": "Represents the possible values for slice values in a pie chart.",
      "enum": [
        "hide",
        "integer",
        "percent"
      ],
      "title": "PieSliceValuesEnum",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "description": "Formatting options for numeric values.",
  "properties": {
    "format": {
      "anyOf": [
        {
          "$ref": "#/$defs/PieSliceValuesEnum"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Controls the display of values in treemap rectangles. Defaults to percent."
    },
    "decimal_places": {
      "anyOf": [
        {
          "maximum": 10,
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Controls the number of decimal places for values.",
      "title": "Decimal Places"
    }
  },
  "title": "TreemapValuesConfig",
  "type": "object"
}

ES|QL Treemap Charts

Represents a Treemap chart configuration within an ES|QL panel.

Attributes:

Name Type Description
metric ESQLMetricTypes

Metric that determines the rectangle sizes. Treemap supports only one metric.

breakdowns list[ESQLTreemapBreakdownTypes]

Breakdowns that determine treemap grouping levels. Maximum 2 breakdowns supported.

Show JSON schema:
{
  "$defs": {
    "ColorValueAssignment": {
      "additionalProperties": false,
      "description": "Manual color assignment to specific categorical values.",
      "properties": {
        "value": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A single category value to assign a color to.",
          "title": "Value"
        },
        "values": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Multiple category values to assign the same color to.",
          "title": "Values"
        },
        "color": {
          "description": "The hex color code to assign (e.g., '#FF0000').",
          "title": "Color",
          "type": "string"
        }
      },
      "required": [
        "color"
      ],
      "title": "ColorValueAssignment",
      "type": "object"
    },
    "ColorValueMapping": {
      "additionalProperties": false,
      "description": "Categorical color mapping for charts keyed by exact values.",
      "properties": {
        "palette": {
          "default": "eui_amsterdam_color_blind",
          "description": "The palette ID to use for unassigned colors.\n\nAvailable palettes:\n- 'default' - Standard EUI palette\n- 'eui_amsterdam_color_blind' - Color-blind safe palette (default)\n- 'kibana_palette' or 'legacy' - Legacy Kibana colors\n- 'elastic_brand' - Elastic brand colors\n- 'gray' - Grayscale palette",
          "title": "Palette",
          "type": "string"
        },
        "assignments": {
          "description": "Manual color assignments to specific data values.",
          "items": {
            "$ref": "#/$defs/ColorValueAssignment"
          },
          "title": "Assignments",
          "type": "array"
        }
      },
      "title": "ColorValueMapping",
      "type": "object"
    },
    "ESQLCustomMetricFormat": {
      "additionalProperties": false,
      "description": "Custom format configuration for ES|QL metrics.\n\nAllows specifying a custom number format pattern.\nThis is separate from LensCustomMetricFormat as ES|QL and Lens formatting may diverge in the future.",
      "properties": {
        "type": {
          "const": "custom",
          "default": "custom",
          "title": "Type",
          "type": "string"
        },
        "pattern": {
          "description": "The pattern to display the number in.",
          "title": "Pattern",
          "type": "string"
        }
      },
      "required": [
        "pattern"
      ],
      "title": "ESQLCustomMetricFormat",
      "type": "object"
    },
    "ESQLMetricFormat": {
      "additionalProperties": false,
      "description": "The format configuration for ES|QL metrics.\n\nSupports standard format types like number, bytes, bits, percent, and duration.\nThis is separate from LensMetricFormat as ES|QL and Lens formatting may diverge in the future.",
      "properties": {
        "type": {
          "enum": [
            "number",
            "bytes",
            "bits",
            "percent",
            "duration"
          ],
          "title": "Type",
          "type": "string"
        },
        "decimals": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The number of decimal places to display. If not specified, defaults to 2 for number/bytes/percent/duration, 0 for bits.",
          "title": "Decimals"
        },
        "suffix": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The suffix to display after the number.",
          "title": "Suffix"
        },
        "compact": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to display the number in a compact format.",
          "title": "Compact"
        },
        "pattern": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The pattern to display the number in.",
          "title": "Pattern"
        }
      },
      "required": [
        "type"
      ],
      "title": "ESQLMetricFormat",
      "type": "object"
    },
    "ESQLMetricFormatTypes": {
      "anyOf": [
        {
          "$ref": "#/$defs/ESQLMetricFormat"
        },
        {
          "$ref": "#/$defs/ESQLCustomMetricFormat"
        }
      ]
    },
    "ESQLMetricTypes": {
      "additionalProperties": false,
      "description": "A metric that is defined in the ESQL query.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A unique identifier. If not provided, one will be generated automatically.",
          "title": "Id"
        },
        "field": {
          "description": "The field in the data view that this metric is based on.",
          "title": "Field",
          "type": "string"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional display label for the metric.",
          "title": "Label"
        },
        "format": {
          "anyOf": [
            {
              "$ref": "#/$defs/ESQLMetricFormatTypes"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The format of the metric (number, bytes, bits, percent, duration, or custom)."
        }
      },
      "required": [
        "field"
      ],
      "title": "ESQLMetric",
      "type": "object"
    },
    "ESQLTreemapBreakdownTypes": {
      "additionalProperties": false,
      "description": "A dimension that is defined in the ESQL query.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A unique identifier. If not provided, one will be generated automatically.",
          "title": "Id"
        },
        "field": {
          "description": "The field to use for the dimension.",
          "title": "Field",
          "type": "string"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional display label for the dimension.",
          "title": "Label"
        },
        "data_type": {
          "anyOf": [
            {
              "const": "date",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The data type of the field. Set to 'date' for time/date fields to enable proper sorting and formatting.",
          "title": "Data Type"
        }
      },
      "required": [
        "field"
      ],
      "title": "ESQLDimension",
      "type": "object"
    },
    "LegendVisibleEnum": {
      "description": "Represents the possible values for the visibility of the legend in a pie chart.",
      "enum": [
        "show",
        "hide",
        "auto"
      ],
      "title": "LegendVisibleEnum",
      "type": "string"
    },
    "LegendWidthEnum": {
      "description": "Represents the possible values for the width/size of the legend.",
      "enum": [
        "small",
        "medium",
        "large",
        "extra_large"
      ],
      "title": "LegendWidthEnum",
      "type": "string"
    },
    "PieSliceValuesEnum": {
      "description": "Represents the possible values for slice values in a pie chart.",
      "enum": [
        "hide",
        "integer",
        "percent"
      ],
      "title": "PieSliceValuesEnum",
      "type": "string"
    },
    "TreemapAppearance": {
      "additionalProperties": false,
      "description": "Formatting options for treemap appearance.",
      "properties": {
        "categories": {
          "anyOf": [
            {
              "$ref": "#/$defs/TreemapCategoriesConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Formatting options for category labels."
        },
        "values": {
          "anyOf": [
            {
              "$ref": "#/$defs/TreemapValuesConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Formatting options for numeric values."
        }
      },
      "title": "TreemapAppearance",
      "type": "object"
    },
    "TreemapCategoriesConfig": {
      "additionalProperties": false,
      "description": "Formatting options for category labels.",
      "properties": {
        "position": {
          "anyOf": [
            {
              "$ref": "#/$defs/TreemapSliceLabelsEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls the visibility of category labels. Defaults to show when not specified."
        }
      },
      "title": "TreemapCategoriesConfig",
      "type": "object"
    },
    "TreemapLegend": {
      "additionalProperties": false,
      "description": "Represents legend formatting options for treemap charts.",
      "properties": {
        "visible": {
          "anyOf": [
            {
              "$ref": "#/$defs/LegendVisibleEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Visibility of the legend. Kibana defaults vary by chart type."
        },
        "position": {
          "anyOf": [
            {
              "enum": [
                "top",
                "right",
                "bottom",
                "left"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Position of the legend.",
          "title": "Position"
        },
        "width": {
          "anyOf": [
            {
              "$ref": "#/$defs/LegendWidthEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Width of the legend."
        },
        "truncate_labels": {
          "anyOf": [
            {
              "maximum": 5,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Number of lines to truncate the legend labels to. Kibana defaults to 1 if not specified. Set to 0 to disable truncation.",
          "title": "Truncate Labels"
        },
        "nested": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to show legend in nested format for multi-level pie charts. Kibana defaults to False if not specified.",
          "title": "Nested"
        },
        "show_single_series": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to show legend when there is only one series. Kibana defaults to false if not specified.",
          "title": "Show Single Series"
        }
      },
      "title": "TreemapLegend",
      "type": "object"
    },
    "TreemapSliceLabelsEnum": {
      "description": "Represents the possible values for treemap slice labels.",
      "enum": [
        "hide",
        "show"
      ],
      "title": "TreemapSliceLabelsEnum",
      "type": "string"
    },
    "TreemapValuesConfig": {
      "additionalProperties": false,
      "description": "Formatting options for numeric values.",
      "properties": {
        "format": {
          "anyOf": [
            {
              "$ref": "#/$defs/PieSliceValuesEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls the display of values in treemap rectangles. Defaults to percent."
        },
        "decimal_places": {
          "anyOf": [
            {
              "maximum": 10,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls the number of decimal places for values.",
          "title": "Decimal Places"
        }
      },
      "title": "TreemapValuesConfig",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Represents a Treemap chart configuration within an ES|QL panel.",
  "properties": {
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A unique identifier. If not provided, one will be generated automatically.",
      "title": "Id"
    },
    "type": {
      "const": "treemap",
      "default": "treemap",
      "description": "The type of chart, which is 'treemap' for this visualization.",
      "title": "Type",
      "type": "string"
    },
    "appearance": {
      "anyOf": [
        {
          "$ref": "#/$defs/TreemapAppearance"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Formatting options for the chart appearance."
    },
    "legend": {
      "anyOf": [
        {
          "$ref": "#/$defs/TreemapLegend"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Formatting options for the chart legend."
    },
    "color": {
      "anyOf": [
        {
          "$ref": "#/$defs/ColorValueMapping"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Formatting options for the chart color."
    },
    "metric": {
      "$ref": "#/$defs/ESQLMetricTypes",
      "description": "Metric that determines the rectangle sizes. Treemap supports only one metric."
    },
    "breakdowns": {
      "description": "Breakdowns that determine treemap grouping levels. Maximum 2 breakdowns supported.",
      "items": {
        "$ref": "#/$defs/ESQLTreemapBreakdownTypes"
      },
      "maxItems": 2,
      "title": "Breakdowns",
      "type": "array"
    }
  },
  "required": [
    "metric",
    "breakdowns"
  ],
  "title": "ESQLTreemapChart",
  "type": "object"
}

validate_breakdowns_count classmethod

validate_breakdowns_count(v)

Validate that treemap has at least one breakdown.