Skip to content

Allow individual Line chart point colors #2705

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

Open
AndiDog opened this issue Apr 2, 2025 · 0 comments
Open

Allow individual Line chart point colors #2705

AndiDog opened this issue Apr 2, 2025 · 0 comments

Comments

@AndiDog
Copy link

AndiDog commented Apr 2, 2025

Is your feature request related to a problem? Please describe.

Only the series is passed to pointColor if that property is provided as function

point.color = getPointColor(serie)
point.borderColor = getPointBorderColor(point)

With that, it's impossible to know which point (x, y, ...) it is, in order to give it the desired color. For example, if I want to do point.y > 10 ? 'red' : 'black', that's not possible with the function's current parameter.

Describe the solution you'd like

I guess this should mostly do it:

-point.color = getPointColor(serie)
+point.color = getPointColor(point)

It's even already the case for borderColor.

I also suggest to assign point.data first so that the callback can use datum.data, xFormatted and yFormatted which include the original values. Else, only the rendered X and Y coordinates are available which may not be of much help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant