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(legend): expose extra raw values #2308

Merged
merged 4 commits into from
Jan 24, 2024

Conversation

markov00
Copy link
Member

@markov00 markov00 commented Jan 23, 2024

Summary

Expose both the formatted and the raw value in the legend extra.

The extra value in the legendItem has now the following shape:

 extraValue?: {
            raw: PrimitiveValue;
            formatted: string;
        };

BREAKING CHANGE

A CustomLegend.item now receive an extra value in the form of {raw: PrimitiveValue;formatted: string;}

Checklist

  • The proper chart type label has been added (e.g. :xy, :partition)
  • The proper feature labels have been added (e.g. :interactions, :axis)
  • 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

@yannbolliger
Copy link
Contributor

Looks perfectly like what we need.

@markov00 markov00 added enhancement New feature or request :legend Legend related issue :xy Bar/Line/Area chart related breaking change labels Jan 23, 2024
@markov00 markov00 marked this pull request as ready for review January 23, 2024 16:29
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, I don't see any issues with these changes.

@markov00 markov00 merged commit 85bfe06 into elastic:main Jan 24, 2024
13 checks passed
@markov00 markov00 deleted the 2024_01_23-extra_raw_value branch January 24, 2024 08:46
nickofthyme pushed a commit that referenced this pull request Jan 24, 2024
# [63.0.0](v62.0.0...v63.0.0) (2024-01-24)

### Features

* **legend:** expose extra raw values ([#2308](#2308)) ([85bfe06](85bfe06))

### BREAKING CHANGES

* **legend:** The `CustomLegend.item` now exposes both the `raw` and the `formatted` version of the extra value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change enhancement New feature or request :legend Legend related issue :xy Bar/Line/Area chart related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants