feat(metric): Add ability to vertically align the metrics values to the middle of the chart#2783
Merged
awahab07 merged 11 commits intoelastic:mainfrom Mar 9, 2026
Conversation
Collaborator
Author
|
buildkite test this |
Collaborator
Author
|
buildkite update vrt |
…ical position is in the middle.
Collaborator
Author
|
buildkite update vrt |
Collaborator
Author
|
buildkite update vrt |
Member
|
buildkite build this |
|
Thanks @awahab07 , can I ask you to fix one detail? The Secondary Metric should always be anchored to the bottom, as the Title is always anchored to the top, and then it is Primary Metric that basically forced its position around the component This image show an extreme version of this concept (font sizes are wrong, it is purely to show the logic): |
…Allow-Middle-Center-Alignment-for-primary-and-secondary-metrics
Collaborator
Author
mariairiartef
approved these changes
Mar 5, 2026
Contributor
mariairiartef
left a comment
There was a problem hiding this comment.
LGTM! Thanks for addressing the comments 💖
markov00
approved these changes
Mar 9, 2026
Collaborator
markov00
left a comment
There was a problem hiding this comment.
Tested locally, looks good to me!
nickofthyme
pushed a commit
that referenced
this pull request
Mar 31, 2026
# [71.4.0](v71.3.0...v71.4.0) (2026-03-31) ### Bug Fixes * **legend:** avoid re-rendering ([#2646](#2646)) ([0ca3289](0ca3289)) * **legend:** keep legend values visible when hiding series in list layout ([#2807](#2807)) ([c5089f5](c5089f5)) ### Features * **highlight:** Add support to configure dimmed (unhighlight) colors for Bar, Partition, Waffle and Flame charts ([#2774](#2774)) ([b39e24d](b39e24d)), closes [#ECF1F9](https://github.com/elastic/elastic-charts/issues/ECF1F9) [#384861](https://github.com/elastic/elastic-charts/issues/384861) * **metric:** Add ability to vertically align the metrics values to the middle of the chart ([#2783](#2783)) ([54ca7cb](54ca7cb)) * **theme:** set default labelOptions.widthLimit in themes and update metric.titleWeight default to 500 ([#2802](#2802)) ([fbb8834](fbb8834))
maryam-saeidi
added a commit
to elastic/kibana
that referenced
this pull request
Apr 2, 2026
## Summary This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@elastic/charts](https://github.com/elastic/elastic-charts) | dependencies | minor | [`71.3.0` -> `71.4.0`](elastic/elastic-charts@v71.3.0...v71.4.0) | ### Release Notes # [71.4.0](elastic/elastic-charts@v71.3.0...v71.4.0) (2026-03-31) ### Bug Fixes * **legend:** avoid re-rendering ([#2646](elastic/elastic-charts#2646)) ([0ca3289](elastic/elastic-charts@0ca3289)) * **legend:** keep legend values visible when hiding series in list layout ([#2807](elastic/elastic-charts#2807)) ([c5089f5](elastic/elastic-charts@c5089f5)) ### Features * **highlight:** Add support to configure dimmed (unhighlight) colors for Bar, Partition, Waffle and Flame charts ([#2774](elastic/elastic-charts#2774)) ([b39e24d](elastic/elastic-charts@b39e24d)), closes [#ECF1F9](https://github.com/elastic/elastic-charts/issues/ECF1F9) [#384861](https://github.com/elastic/elastic-charts/issues/384861) * **metric:** Add ability to vertically align the metrics values to the middle of the chart ([#2783](elastic/elastic-charts#2783)) ([54ca7cb](elastic/elastic-charts@54ca7cb)) * **theme:** set default labelOptions.widthLimit in themes and update metric.titleWeight default to 500 ([#2802](elastic/elastic-charts#2802)) ([fbb8834](elastic/elastic-charts@fbb8834)) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Abdul Zahid <awahab07@yahoo.com>
paulinashakirova
pushed a commit
to paulinashakirova/kibana
that referenced
this pull request
Apr 2, 2026
## Summary This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@elastic/charts](https://github.com/elastic/elastic-charts) | dependencies | minor | [`71.3.0` -> `71.4.0`](elastic/elastic-charts@v71.3.0...v71.4.0) | ### Release Notes # [71.4.0](elastic/elastic-charts@v71.3.0...v71.4.0) (2026-03-31) ### Bug Fixes * **legend:** avoid re-rendering ([elastic#2646](elastic/elastic-charts#2646)) ([0ca3289](elastic/elastic-charts@0ca3289)) * **legend:** keep legend values visible when hiding series in list layout ([elastic#2807](elastic/elastic-charts#2807)) ([c5089f5](elastic/elastic-charts@c5089f5)) ### Features * **highlight:** Add support to configure dimmed (unhighlight) colors for Bar, Partition, Waffle and Flame charts ([elastic#2774](elastic/elastic-charts#2774)) ([b39e24d](elastic/elastic-charts@b39e24d)), closes [#ECF1F9](https://github.com/elastic/elastic-charts/issues/ECF1F9) [#384861](https://github.com/elastic/elastic-charts/issues/384861) * **metric:** Add ability to vertically align the metrics values to the middle of the chart ([elastic#2783](elastic/elastic-charts#2783)) ([54ca7cb](elastic/elastic-charts@54ca7cb)) * **theme:** set default labelOptions.widthLimit in themes and update metric.titleWeight default to 500 ([elastic#2802](elastic/elastic-charts#2802)) ([fbb8834](elastic/elastic-charts@fbb8834)) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Abdul Zahid <awahab07@yahoo.com>
awahab07
added a commit
to elastic/kibana
that referenced
this pull request
Apr 7, 2026
- Adds a **Middle** option to Lens Metric → Style → Primary metric → Position (**Top | Middle | Bottom**). - Enables vertically centered primary metric positioning using elastic-charts support from [elastic/elastic-charts#2783](elastic/elastic-charts#2783).
kelvtanv
pushed a commit
to kelvtanv/kibana
that referenced
this pull request
Apr 7, 2026
…c#260902) - Adds a **Middle** option to Lens Metric → Style → Primary metric → Position (**Top | Middle | Bottom**). - Enables vertically centered primary metric positioning using elastic-charts support from [elastic/elastic-charts#2783](elastic/elastic-charts#2783).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
The
valuePositionprop in theMetricStyletheme now supports a new'middle'value, allowing the primary metric value to be vertically centered within the chart area. When usingvaluePosition: 'middle', the title and subtitle remain at the top, while the primary metric value is centered with the secondary metric (extra) displayed directly below it.234956-Metric-chart-primary-value-vertical-middle-alignment.mov
Details
'middle'to thevaluePositionunion type inMetricStyleinterface ('top' | 'middle' | 'bottom')Update 01
see
Issues
Implement the underlying functionality required by elastic/kibana#234956.
Checklist
:xy,:partition):interactions,:axis)closes #123,fixes #123)packages/charts/src/index.tslightanddarkthemes