Skip to content

Mosaic Chart Panel Configuration

The Mosaic chart panel visualizes categorical data as proportional rectangles, showing category distributions at a glance. Mosaic charts support exactly one metric, one dimension, and an optional breakdown.


Lens Mosaic Charts

Represents a Mosaic chart configuration within a Lens panel.

Mosaic charts visualize categorical data as proportional rectangles, where each rectangle's area represents its proportion of the whole. Mosaic charts support exactly one metric, one dimension, and an optional breakdown.

Examples:

Simple mosaic chart showing request distribution:

lens:
  type: mosaic
  data_view: "logs-*"
  dimension:
    field: "http.request.method"
    type: values
  metric:
    aggregation: count

Mosaic chart with breakdown:

lens:
  type: mosaic
  data_view: "logs-*"
  dimension:
    field: "http.request.method"
    type: values
  breakdown:
    field: "service.name"
    type: values
  metric:
    aggregation: count

Mosaic chart with custom colors:

lens:
  type: mosaic
  data_view: "metrics-*"
  dimension:
    field: "service.name"
    type: values
  metric:
    aggregation: count
  color:
    palette: 'eui_amsterdam_color_blind'
    assignments:
      - values: ['api-gateway']
        color: '#00BF6F'
      - values: ['database']
        color: '#006BB4'

Mosaic chart with legend options:

lens:
  type: mosaic
  data_view: "logs-*"
  dimension:
    field: "http.request.method"
    type: values
  metric:
    aggregation: count
  legend:
    visible: show
    position: bottom

Attributes:

Name Type Description
data_view str

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

metric LensDataMetricTypes

Metric that determines the size of rectangles. Mosaic charts support only one metric.

dimension LensDimensionTypes

Primary dimension for grouping data. Mosaic charts support only one dimension.

breakdown LensBreakdownTypes | None

Optional secondary breakdown for splitting the mosaic into sub-groups.

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"
    },
    "LensDateHistogramDimension": {
      "additionalProperties": false,
      "description": "Represents a histogram dimension configuration within a Lens chart.\n\nDate histogram dimensions are used for aggregating data into buckets based on numeric ranges.",
      "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"
        }
      },
      "required": [
        "field"
      ],
      "title": "LensDateHistogramDimension",
      "type": "object"
    },
    "LensDateMathMinimumInterval": {
      "anyOf": [
        {
          "const": "auto",
          "type": "string"
        },
        {
          "pattern": "^[1-9][0-9]*(ms|s|m|h|d|w|M|q|y)$",
          "type": "string"
        }
      ]
    },
    "LensDimensionTypes": {
      "anyOf": [
        {
          "$ref": "#/$defs/LensTermsDimension"
        },
        {
          "$ref": "#/$defs/LensMultiTermsDimension"
        },
        {
          "$ref": "#/$defs/LensDateHistogramDimension"
        },
        {
          "$ref": "#/$defs/LensFiltersDimension"
        },
        {
          "$ref": "#/$defs/LensIntervalsDimension"
        }
      ]
    },
    "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"
    },
    "LensFiltersDimension": {
      "additionalProperties": false,
      "description": "Represents a filters dimension configuration within a Lens chart.\n\nFilters dimensions are used for filtering data based on 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 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"
        }
      },
      "required": [
        "filters"
      ],
      "title": "LensFiltersDimension",
      "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"
    },
    "LensIntervalsDimension": {
      "additionalProperties": false,
      "description": "Represents an intervals dimension configuration within a Lens chart.\n\nIntervals dimensions are used for aggregating data based on numeric ranges.",
      "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"
        }
      },
      "required": [
        "field"
      ],
      "title": "LensIntervalsDimension",
      "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"
    },
    "LensMultiTermsDimension": {
      "additionalProperties": false,
      "description": "Represents a multi-field top values dimension configuration within a Lens chart.\n\nMulti-terms dimensions are used for aggregating data based on unique combinations\nof values across multiple fields.",
      "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"
        }
      },
      "required": [
        "fields"
      ],
      "title": "LensMultiTermsDimension",
      "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"
    },
    "LensTermsDimension": {
      "additionalProperties": false,
      "description": "Represents a single-field top values dimension configuration within a Lens chart.\n\nTerms dimensions are used for aggregating data based on unique values of a single 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 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"
        }
      },
      "required": [
        "field"
      ],
      "title": "LensTermsDimension",
      "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"
    },
    "MosaicAppearance": {
      "additionalProperties": false,
      "description": "Formatting options for value labels.",
      "properties": {
        "values": {
          "anyOf": [
            {
              "$ref": "#/$defs/MosaicValuesConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Formatting options for numeric values."
        }
      },
      "title": "MosaicAppearance",
      "type": "object"
    },
    "MosaicLegend": {
      "additionalProperties": false,
      "description": "Represents legend formatting options for mosaic 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 mosaic 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": "MosaicLegend",
      "type": "object"
    },
    "MosaicValuesConfig": {
      "additionalProperties": false,
      "description": "Formatting options for value labels.",
      "properties": {
        "format": {
          "anyOf": [
            {
              "enum": [
                "percent",
                "value",
                "hide"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls how values are displayed in the mosaic chart. Kibana defaults to 'percent' if not specified.",
          "title": "Format"
        },
        "decimal_places": {
          "anyOf": [
            {
              "maximum": 10,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls the number of decimal places for values in the mosaic chart. Kibana defaults to 2 if not specified.",
          "title": "Decimal Places"
        }
      },
      "title": "MosaicValuesConfig",
      "type": "object"
    },
    "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"
    }
  },
  "additionalProperties": false,
  "description": "Represents a Mosaic chart configuration within a Lens panel.\n\nMosaic charts visualize categorical data as proportional rectangles,\nwhere each rectangle's area represents its proportion of the whole.\nMosaic charts support exactly one metric, one dimension, and an optional breakdown.\n\nExamples:\n    Simple mosaic chart showing request distribution:\n    ```yaml\n    lens:\n      type: mosaic\n      data_view: \"logs-*\"\n      dimension:\n        field: \"http.request.method\"\n        type: values\n      metric:\n        aggregation: count\n    ```\n\n    Mosaic chart with breakdown:\n    ```yaml\n    lens:\n      type: mosaic\n      data_view: \"logs-*\"\n      dimension:\n        field: \"http.request.method\"\n        type: values\n      breakdown:\n        field: \"service.name\"\n        type: values\n      metric:\n        aggregation: count\n    ```\n\n    Mosaic chart with custom colors:\n    ```yaml\n    lens:\n      type: mosaic\n      data_view: \"metrics-*\"\n      dimension:\n        field: \"service.name\"\n        type: values\n      metric:\n        aggregation: count\n      color:\n        palette: 'eui_amsterdam_color_blind'\n        assignments:\n          - values: ['api-gateway']\n            color: '#00BF6F'\n          - values: ['database']\n            color: '#006BB4'\n    ```\n\n    Mosaic chart with legend options:\n    ```yaml\n    lens:\n      type: mosaic\n      data_view: \"logs-*\"\n      dimension:\n        field: \"http.request.method\"\n        type: values\n      metric:\n        aggregation: count\n      legend:\n        visible: show\n        position: bottom\n    ```",
  "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": "mosaic",
      "default": "mosaic",
      "title": "Type",
      "type": "string"
    },
    "appearance": {
      "anyOf": [
        {
          "$ref": "#/$defs/MosaicAppearance"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Formatting options for the chart appearance."
    },
    "legend": {
      "anyOf": [
        {
          "$ref": "#/$defs/MosaicLegend"
        },
        {
          "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 mosaic chart.",
      "title": "Data View",
      "type": "string"
    },
    "metric": {
      "$ref": "#/$defs/LensDataMetricTypes",
      "description": "Metric that determines the size of rectangles. Mosaic charts support only one metric."
    },
    "dimension": {
      "$ref": "#/$defs/LensDimensionTypes",
      "description": "Primary dimension for grouping data. Mosaic charts support only one dimension."
    },
    "breakdown": {
      "anyOf": [
        {
          "$ref": "#/$defs/LensBreakdownTypes"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional secondary breakdown for splitting the mosaic into sub-groups."
    }
  },
  "required": [
    "data_view",
    "metric",
    "dimension"
  ],
  "title": "LensMosaicChart",
  "type": "object"
}

Mosaic Chart Legend

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

Represents legend formatting options for mosaic charts.

Attributes:

Name Type Description
truncate_labels int | None

Number of lines to truncate the legend labels to. Kibana defaults to 1 if not specified. Set to 0 to disable truncation.

nested bool | None

Whether to show legend in nested format for multi-level mosaic charts. Kibana defaults to False if not specified.

show_single_series bool | None

Whether to show legend when there is only one series. Kibana defaults to false if not specified.

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 mosaic 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 mosaic 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": "MosaicLegend",
  "type": "object"
}

Mosaic Chart Appearance

Formatting options for value labels.

Attributes:

Name Type Description
values MosaicValuesConfig | None

Formatting options for numeric values.

Show JSON schema:
{
  "$defs": {
    "MosaicValuesConfig": {
      "additionalProperties": false,
      "description": "Formatting options for value labels.",
      "properties": {
        "format": {
          "anyOf": [
            {
              "enum": [
                "percent",
                "value",
                "hide"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls how values are displayed in the mosaic chart. Kibana defaults to 'percent' if not specified.",
          "title": "Format"
        },
        "decimal_places": {
          "anyOf": [
            {
              "maximum": 10,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls the number of decimal places for values in the mosaic chart. Kibana defaults to 2 if not specified.",
          "title": "Decimal Places"
        }
      },
      "title": "MosaicValuesConfig",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Formatting options for value labels.",
  "properties": {
    "values": {
      "anyOf": [
        {
          "$ref": "#/$defs/MosaicValuesConfig"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Formatting options for numeric values."
    }
  },
  "title": "MosaicAppearance",
  "type": "object"
}

ES|QL Mosaic Charts

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

Mosaic charts visualize categorical data as proportional rectangles, using ES|QL queries to aggregate and group the data. Mosaic charts support exactly one metric, one dimension, and an optional breakdown.

Examples:

ES|QL mosaic chart with STATS query:

esql:
  type: mosaic
  query: |
    FROM logs-*
    | STATS count = COUNT(*) BY http.request.method
  metric:
    field: "count"
  dimension:
    field: "http.request.method"

ES|QL mosaic chart with breakdown:

esql:
  type: mosaic
  query: |
    FROM logs-*
    | STATS count = COUNT(*) BY http.request.method, service.name
  metric:
    field: "count"
  dimension:
    field: "http.request.method"
  breakdown:
    field: "service.name"

Attributes:

Name Type Description
metric ESQLMetricTypes

Metric that determines the size of rectangles. Mosaic charts support only one metric.

dimension ESQLDimensionTypes

Primary dimension for grouping data. Mosaic charts support only one dimension.

breakdown ESQLBreakdownTypes | None

Optional secondary breakdown for splitting the mosaic into sub-groups.

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"
    },
    "ESQLBreakdownTypes": {
      "additionalProperties": false,
      "description": "A breakdown dimension for ESQL charts that supports collapse aggregation.\n\nBreakdowns slice data into categories (e.g. bar segments, waffle sections).\nUnlike plain dimensions, breakdowns support the ``collapse`` aggregation\nwhich merges multiple dimension values into a single bucket using a summary function.",
      "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"
        },
        "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": "ESQLBreakdown",
      "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"
    },
    "ESQLDimensionTypes": {
      "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"
    },
    "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"
    },
    "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"
    },
    "MosaicAppearance": {
      "additionalProperties": false,
      "description": "Formatting options for value labels.",
      "properties": {
        "values": {
          "anyOf": [
            {
              "$ref": "#/$defs/MosaicValuesConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Formatting options for numeric values."
        }
      },
      "title": "MosaicAppearance",
      "type": "object"
    },
    "MosaicLegend": {
      "additionalProperties": false,
      "description": "Represents legend formatting options for mosaic 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 mosaic 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": "MosaicLegend",
      "type": "object"
    },
    "MosaicValuesConfig": {
      "additionalProperties": false,
      "description": "Formatting options for value labels.",
      "properties": {
        "format": {
          "anyOf": [
            {
              "enum": [
                "percent",
                "value",
                "hide"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls how values are displayed in the mosaic chart. Kibana defaults to 'percent' if not specified.",
          "title": "Format"
        },
        "decimal_places": {
          "anyOf": [
            {
              "maximum": 10,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Controls the number of decimal places for values in the mosaic chart. Kibana defaults to 2 if not specified.",
          "title": "Decimal Places"
        }
      },
      "title": "MosaicValuesConfig",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Represents a Mosaic chart configuration within an ES|QL panel.\n\nMosaic charts visualize categorical data as proportional rectangles,\nusing ES|QL queries to aggregate and group the data.\nMosaic charts support exactly one metric, one dimension, and an optional breakdown.\n\nExamples:\n    ES|QL mosaic chart with STATS query:\n    ```yaml\n    esql:\n      type: mosaic\n      query: |\n        FROM logs-*\n        | STATS count = COUNT(*) BY http.request.method\n      metric:\n        field: \"count\"\n      dimension:\n        field: \"http.request.method\"\n    ```\n\n    ES|QL mosaic chart with breakdown:\n    ```yaml\n    esql:\n      type: mosaic\n      query: |\n        FROM logs-*\n        | STATS count = COUNT(*) BY http.request.method, service.name\n      metric:\n        field: \"count\"\n      dimension:\n        field: \"http.request.method\"\n      breakdown:\n        field: \"service.name\"\n    ```",
  "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": "mosaic",
      "default": "mosaic",
      "title": "Type",
      "type": "string"
    },
    "appearance": {
      "anyOf": [
        {
          "$ref": "#/$defs/MosaicAppearance"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Formatting options for the chart appearance."
    },
    "legend": {
      "anyOf": [
        {
          "$ref": "#/$defs/MosaicLegend"
        },
        {
          "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 size of rectangles. Mosaic charts support only one metric."
    },
    "dimension": {
      "$ref": "#/$defs/ESQLDimensionTypes",
      "description": "Primary dimension for grouping data. Mosaic charts support only one dimension."
    },
    "breakdown": {
      "anyOf": [
        {
          "$ref": "#/$defs/ESQLBreakdownTypes"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional secondary breakdown for splitting the mosaic into sub-groups."
    }
  },
  "required": [
    "metric",
    "dimension"
  ],
  "title": "ESQLMosaicChart",
  "type": "object"
}