Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(metric): trend with string value #2011

Merged
merged 6 commits into from
Apr 11, 2023

Conversation

markov00
Copy link
Member

@markov00 markov00 commented Apr 3, 2023

Summary

This PR adds the ability to show a text, rather than a value, when rendering a metric with a trend in the background.

image

Details

This is a different Datum type, with a value: string and no valueFormatter since the string doesn't need an additional treatment.

Issues

fix #1953

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

@markov00
Copy link
Member Author

markov00 commented Apr 5, 2023

buildkite update screenshots

@markov00 markov00 added API Changes the external API types :metric Related to Metric chart labels Apr 5, 2023
@markov00 markov00 changed the title feat: add text value with trend feat(metric): add text value with trend Apr 5, 2023
@markov00 markov00 changed the title feat(metric): add text value with trend feat(metric): trend with string value Apr 5, 2023
@markov00 markov00 marked this pull request as ready for review April 5, 2023 13:23
Copy link
Collaborator

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested on pr deployment, works well with truncating long text. It seem like most usage here would be short strings but may think about multiline text as a future enhancement.

@markov00 markov00 merged commit 91d7695 into elastic:main Apr 11, 2023
@markov00 markov00 deleted the 2023_04_03-add_text_with_metric_trend branch April 11, 2023 13:32
nickofthyme pushed a commit that referenced this pull request Apr 18, 2023
# [56.0.0](v55.0.0...v56.0.0) (2023-04-18)

### Bug Fixes

* **deps:** update dependency @elastic/eui to ^76.4.0 ([#2008](#2008)) ([95176e1](95176e1))
* **deps:** update dependency @elastic/eui to v77 ([#2018](#2018)) ([c079730](c079730))
* **interactions:** brushing over origin coordinates ([#2013](#2013)) ([937feb0](937feb0))
* **tooltip:** custom tooltip header context ([#1989](#1989)) ([1e5b861](1e5b861))

### Features

* **metric:** trend with string value ([#2011](#2011)) ([91d7695](91d7695))

### BREAKING CHANGES

* **tooltip:** The `header` property of `TooltipInfo` type was simplified to `PointerValue` as to include only relevant properties. This change is propagated to all other types using `header` as a `TooltipValue`. The `TooltipInfo.values` used to conditionally pass only highlighted `TooltipValue`s when using a `customTooltip` and now _always_ passes all `values`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes the external API types :metric Related to Metric chart
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[metric] render trend with string value
2 participants