Skip to content

Conversation

@mariairiartef
Copy link
Contributor

@mariairiartef mariairiartef commented Jun 11, 2025

Closes elastic/kibana#220618

Summary

Updates metric chart with new progress bar styling, distinct text colors for subtitle and extra elements, and configurable value (primary metric) positioning options (top/bottom). Additionally, creates a secondary metric component that can be used instead of a custom component.

Screenshot 2025-07-24 at 18 51 58

Resources

  • Figma with the new metric chart layout designs in Update (9.0) tab
  • Document containing pre-implementation questions and answers

BREAKING CHANGE

The valuesTextAlign property in MetricStyle has been removed. Use the new valueTextAlign (for main value alignment) and extraTextAlign (for extra/secondary alignment) properties instead.

Details

  • Update metric chart theme settings (done in theme.ts)
    • Remove valuesTextAlign setting
    • Add extraTextAlign, valueTextAlign, valuePosition, titleWeight settings
    • Add textSubtitleDarkColor, textSubtitleLightColor, textExtraDarkColor, textExtraLightColor
  • Separate the values block into extra block and value block so both can be handled independently
    (done in text.tsx)
  • Add configuration for moving the value block from bottom to top
    • Includes updating icon handling using grid styling
  • Add configuration for making the title font weight 'bold' or 'regular'
  • Update progress bar style to align with the designs
  • Support different progress bar thicknesses based on height
  • Support different text colors for subtitle and extra texts
  • Add support for secondary metric display with optional badge positioning
  • Add new storybook story to test the new layout configuration
  • Update test cases and add new tests for the new layout

Things that haven't been yet addressed

  • Update target style when progress bar is shown in bullet graph
  • Handle tittle and subtitle separately so metric icon is aligned with title only

Issues

closes elastic/kibana#220618

Checklist

  • The proper chart type label has been added (e.g. :xy, :partition)
  • The proper feature labels have been added (e.g. :interactions, :axis)
  • All related issues have been linked (i.e. closes #123, fixes #123)
  • New public API exports have been added to packages/charts/src/index.ts
  • Unit tests have been added or updated to match the most common scenarios
  • The proper documentation and/or storybook story has been added or updated
  • The code has been checked for cross-browser compatibility (Chrome, Firefox, Safari, Edge)
  • Visual changes have been tested with light and dark themes

@mariairiartef mariairiartef force-pushed the metric-new-positions branch from cc2a37b to ffbcf1b Compare June 11, 2025 15:31
@mariairiartef mariairiartef force-pushed the metric-new-positions branch from 3798595 to c97c469 Compare June 12, 2025 14:46
@mariairiartef mariairiartef self-assigned this Jun 16, 2025
@mariairiartef mariairiartef added the :metric Related to Metric chart label Jun 16, 2025
@mariairiartef mariairiartef force-pushed the metric-new-positions branch from 0ce7af1 to 797dc92 Compare June 17, 2025 07:28
@mariairiartef mariairiartef force-pushed the metric-new-positions branch from dc6d8b1 to 5fcef4d Compare June 17, 2025 07:35
@mariairiartef mariairiartef requested a review from Copilot June 18, 2025 08:21

This comment was marked as outdated.

@mariairiartef mariairiartef force-pushed the metric-new-positions branch from fec45a7 to 7dc5b9c Compare June 23, 2025 09:51
delanni pushed a commit to delanni/kibana that referenced this pull request Aug 5, 2025
…9323)

Part of elastic#228964

## Summary

As part of elastic#228964, this extracts secondary metric information into a
utility function. The goal is to prepare for the adoption of the new
metric chart version introduced in elastic/elastic-charts#2666, so we
can use the default secondary metric component with the data provided by
this utility.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Marco Liberati <[email protected]>
@mariairiartef
Copy link
Contributor Author

buildkite update screenshots

@mariairiartef
Copy link
Contributor Author

buildkite update screenshots

@markov00 markov00 self-requested a review August 7, 2025 10:29
@mariairiartef mariairiartef removed the request for review from nickofthyme August 8, 2025 09:54
@mariairiartef
Copy link
Contributor Author

buildkite update screenshots

@mariairiartef
Copy link
Contributor Author

buildkite update screenshots

@mariairiartef mariairiartef added :theme :chart Chart element related issue labels Aug 11, 2025
@mariairiartef mariairiartef merged commit c13409a into elastic:main Aug 11, 2025
14 checks passed
nickofthyme pushed a commit that referenced this pull request Aug 11, 2025
# [71.0.0](v70.1.3...v71.0.0) (2025-08-11)

### Features

* **metric:** add new layout configurations ([#2666](#2666)) ([c13409a](c13409a))

### BREAKING CHANGES

* **metric:** The `valuesTextAlign` property in `MetricStyle` has been removed. Use the new `valueTextAlign` (for main value alignment) and `extraTextAlign` (for extra/secondary alignment) properties instead.
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Aug 18, 2025
…9323)

Part of elastic#228964

## Summary

As part of elastic#228964, this extracts secondary metric information into a
utility function. The goal is to prepare for the adoption of the new
metric chart version introduced in elastic/elastic-charts#2666, so we
can use the default secondary metric component with the data provided by
this utility.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Marco Liberati <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change :chart Chart element related issue enhancement New feature or request :metric Related to Metric chart :theme

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Metric chart] New layout in elastic-charts

4 participants