You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: unify chart dimension settings into shared snippets (#4773) (#7031)
## Summary
This PR addresses #4773 by single-sourcing the bucket dimension **Data**
settings that Lens chart types share (Top values, Date histogram,
Intervals, Filters, and Collapse by) into reusable snippets, and by
bringing each page up to standard against the Kibana source so the lists
are exhaustive and accurate.
Each page now shows only the functions that its dimensions actually
support, with the same wording sourced from one place.
### New snippets (`explore-analyze/_snippets/`)
- **`lens-bucket-top-values.md`**: the **Top values** function. The
default count is verified against source: `9` on {applies_to}`stack: ga
9.4`/serverless, and on `stack: 9.0-9.3` it defaults to `5` for the
first dimension and `3` for each additional dimension.
- **`lens-bucket-date-histogram.md`**, **`lens-bucket-intervals.md`**,
**`lens-bucket-filters.md`**: the remaining bucket functions.
- **`lens-collapse-by.md`**: the dimension-level **Collapse by**
control.
### Pages rewired to include the snippets
- **Partition** (`pie-charts.md`, `waffle-charts.md`,
`treemap-charts.md`, `mosaic-charts.md`)
- **`heat-map-charts.md`**, **`tag-cloud-charts.md`**, **`tables.md`**
- **XY** (`bar-charts.md`, `line-charts.md`, `area-charts.md`)
- **`metric-charts.md`**
### Accuracy fixes made while single-sourcing (verified against
`elastic/kibana` at HEAD)
- **Heat map**: added the **Filters** function to both axes (the axis
predicate is `isBucketed`, so Filters applies but was undocumented).
- **Metric**: the **Break down by** dimension now lists the full bucket
function set (Date histogram, Intervals, Filters) instead of Top values
only, matching its `isBucketed` predicate.
- **Collapse by** is now placed once per dimension and only where the
editor exposes it: all partition dimensions, the XY and metric **Break
down by** groups, and table **Rows**. It is correctly absent from XY
horizontal axes, table **Split metrics by** columns, heat map axes, tag
clouds, and gauges.
- **Intervals** now documents granularity, custom ranges, and "Include
empty rows" (on by default), which were missing on several pages.
- The shared advanced-settings snippet had partition-specific "tile"
wording neutralized so it reads correctly on every chart type.
- **Region map** and **gauge** are intentionally left as-is: region
map's **Region key** only accepts string buckets (Top values and
Filters), and gauges have no bucket dimension.
### Snippet consolidation
- Merged the Top values primary/secondary snippet pair into a single
snippet (the legacy default now states the real
first-vs-additional-dimension rule rather than approximating it across
two files).
- Pointed the area chart vertical axis at the shared
`lens-value-advanced-settings.md` snippet and removed the area-only
variant, which was an incomplete duplicate of the same XY metric
options.
## Resolves
Closes#4773
---
> **AI-generated draft** — created with Claude Opus 4.8.
> Review all generated content for factual accuracy before merging.
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: explore-analyze/_snippets/lens-breakdown-advanced-settings.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,6 @@ Several advanced options allow you to refine the behavior of the breakdown:
4
4
-**Include documents without the selected field**: Off by default.
5
5
-**Group remaining values as "Other"**: On by default.
6
6
-**Enable accuracy mode**: This option improves results for high-cardinality data, but increases the load on the {{es}} cluster.
7
-
-**Include values**: Values from the breakdown dimension to always show a tile for.
8
-
-**Exclude values**: Values from the breakdown dimension to always exclude from the displayed tiles.
7
+
-**Include values**: Values from the dimension to always include, even if they aren't among the top values. You can enter exact values or a regular expression.
8
+
-**Exclude values**: Values from the dimension to always exclude. You can enter exact values or a regular expression.
-**Intervals**: Create numeric ranges for continuous data by grouping a numeric field into buckets.
2
+
-**Field**: Select the numeric field to create intervals from.
3
+
-**Intervals granularity**: Use the slider to control how many intervals to create. {{kib}} divides the field into evenly spaced intervals (incremented by 10, 5, or 2) between the field's minimum and maximum values. The minimum granularity is 1, and the maximum is set by the `histogram:maxBars` advanced setting.
4
+
-**Create custom ranges**: Define your own ranges with specific lower and upper bounds and optional labels, instead of using the automatic granularity.
5
+
-**Include empty rows**: Include intervals that contain no matching documents. On by default.
-**Top values**: Show the most common values of a field.
2
+
-**Field**: Select the field to group by. You can add up to 4 fields to create multi-term groups. When multiple fields are selected, each group represents a unique combination of values across those fields. You can reorder the fields by dragging them to change their priority.
3
+
-**Number of values**: How many top values to display. The default number of values depends on your environment:
4
+
- {applies_to}`serverless: ga` {applies_to}`stack: ga 9.4` Defaults to 9.
5
+
- {applies_to}`stack: ga 9.0-9.3` Defaults to 5 for the first Top values dimension added to the chart and 3 for each additional one.
-**Collapse by**: Aggregate all metric values that share the same value for this dimension into a single number, removing it as an independent grouping. Available aggregation methods: `Sum`, `Min`, `Max`, or `Average`.
-**Rank by**: Specifies the dimension the top values are ranked by. Available options:
2
2
-**Count of records**: Rank by the number of documents containing each value. This is the default when a metric is defined.
3
3
-**Alphabetical**: Rank by the term key alphabetically. This is the default when no metric is defined.
4
-
-**Rarity**: Find terms that appear in very few documents, using a [rare terms aggregation](elasticsearch://reference/aggregations/search-aggregations-bucket-rare-terms-aggregation.md). You can configure the **Max doc count** to set the maximum number of documents a term can appear in to be considered rare (default: 1, max: 100). Only available for non-numeric fields and single-field terms.
4
+
-**Rarity**: Find terms that appear in very few documents, using a [rare terms aggregation](elasticsearch://reference/aggregations/search-aggregations-bucket-rare-terms-aggregation.md). You can configure the **Max doc count per term** to set the maximum number of documents a term can appear in to be considered rare (default: 1, max: 100). Available for single-field terms only, and not for floating-point numeric fields (`float`, `double`, `half_float`, and `scaled_float`).
5
5
-**Significance**: Find statistically unusual terms compared to the overall data set, using a [significant terms aggregation](elasticsearch://reference/aggregations/search-aggregations-bucket-significantterms-aggregation.md). Only available for `keyword` fields and single-field terms.
6
6
-**Custom**: Define a custom metric aggregation to rank by (for example, rank by the sum of a numeric field rather than by count).
7
7
-**Rank direction**: Ascending or descending order. Disabled when **Rank by** is set to **Rarity** or **Significance**.
Copy file name to clipboardExpand all lines: explore-analyze/visualize/charts/area-charts.md
+20-21Lines changed: 20 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,22 +126,20 @@ Customize your area chart to match the information you need and how you want it
126
126
**Data**
127
127
:
128
128
- **Functions**:
129
-
- **Top values**: Create separate areas for the most common values in a field.
130
-
- **Field**: Select the field to group by. You can add up to 4 fields. When multiple fields are selected, each area represents a unique combination of values across those fields. You can reorder the fields by dragging them to change their priority.
131
-
- **Number of values**: How many top values to display. The default number of values depends on your environment:
132
-
- {applies_to}`serverless: ga` {applies_to}`stack: ga 9.4` Defaults to 9.
: **Name**: By default, the chart uses the function or formula as title. It's a best practice to customize this with a meaningful title.
@@ -151,7 +149,7 @@ Customize your area chart to match the information you need and how you want it
151
149
**Data**
152
150
: To represent the metrics or values you want to visualize, you can use quick functions like Average, Count, Percentile, Counter rate, or create custom calculations with formulas. Refer to [](/explore-analyze/visualize/lens.md#lens-formulas) for examples.
@@ -168,22 +166,23 @@ You can split your data by a categorical field to create multiple stacked or ove
168
166
**Data**
169
167
:
170
168
- **Functions**:
171
-
- **Top values**: Create separate areas for the most common values in a field.
172
-
- **Field**: Select the field to group by. You can add up to 4 fields. When multiple fields are selected, each area represents a unique combination of values across those fields. You can reorder the fields by dragging them to change their priority.
173
-
- **Number of values**: How many top values to display. The default number of values depends on your environment:
174
-
- {applies_to}`serverless: ga` {applies_to}`stack: ga 9.4` Defaults to 9.
: The dimension that creates your individual bars. Common functions include:
362
-
- **Top values**: Create bars for the most common values in a field.
363
-
- **Field**: Select the field to group by. You can add up to 4 fields to create multi-term bars. When multiple fields are selected, each bar represents a unique combination of values across those fields. You can reorder the fields by dragging them to change their priority.
364
-
- **Number of values**: How many top values to display. The default number of values depends on your environment:
365
-
- {applies_to}`serverless: ga` {applies_to}`stack: ga 9.4` Defaults to 9.
366
-
- {applies_to}`stack: ga 9.0-9.3` Defaults to 5.
361
+
: The dimension that creates your individual bars. It supports the following functions:
: Define the formatting of the horizontal axis, including:
@@ -399,23 +398,25 @@ Customize your bar chart to display exactly the information you need, formatted
399
398
### Breakdown settings [breakdown-options]
400
399
401
400
**Data**
402
-
: Split your bars into segments or groups based on another dimension. Each unique value creates its own segment or bar, allowing you to show composition or compare metrics across multiple dimensions. Common functions include:
403
-
- **Top values**: Create bar segments for the most common values in a field.
404
-
- **Field**: Select the field to group by. You can add up to 4 fields. When multiple fields are selected, each segment represents a unique combination of values across those fields. You can reorder the fields by dragging them to change their priority.
405
-
- **Number of values**: How many top values to display. The default number of values depends on your environment:
406
-
- {applies_to}`serverless: ga` {applies_to}`stack: ga 9.4` Defaults to 9.
407
-
- {applies_to}`stack: ga 9.0-9.3` Defaults to 3.
401
+
: Split your bars into segments or groups based on another dimension. Each unique value creates its own segment or bar, allowing you to show composition or compare metrics across multiple dimensions. It supports the following functions:
0 commit comments