feat(Line) Allow pointLabel AccessorFunc
to return the full point info
#1981
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.
General request
Hi,
I noticed that the
label
property of the @bar chart allowed to get the full point info (id, value, ...).It seems that the
AccessorFunc
of the @line chart only pass down the data.I think that enhancing this function to support the full
Point
type would allow a better customisation at the data point level.My proposition is to add the
point: Point
directly to the function in order to avoid any breaking changes, but if you think that updating thedatum: Point['data']
todatum: Point
is more suitable, I can update my PR to match this quickly.Case details
I'm requesting this change because in my case I need to format the value at a data point level.
Technically, every data point could have a different formatting in my charts, and without getting the id behind the value (contained in the
Point
but not thePoint['data']
), I have no way to know which value is linked to which formatting if I have more than 1 time the same value.