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

support different color maps #5117

Closed
flashpixx opened this issue Jan 8, 2018 · 6 comments
Closed

support different color maps #5117

flashpixx opened this issue Jan 8, 2018 · 6 comments

Comments

@flashpixx
Copy link

flashpixx commented Jan 8, 2018

Hello,

I'm dealing with a lot of different data sets. I'm using also Chart.js plugins e.g. boxplot.
A request is, that Chart.js can support different colormaps e.g. like Matlab
This can be helpful for stacked datasets or grouped datasets, so that an item of a group / stack will get a unique color. IMHO something like: colormap("jet", 5) returns 5 colors by the jet colormap.
Also a callback mechanism for generating such maps is very helpful

@flashpixx
Copy link
Author

This project creates such maps

@simonbrunel
Copy link
Member

simonbrunel commented Jan 8, 2018

How do you see that feature supported/integrated? Do you have some examples/codes of how you would like to use it with your charts?

@etimberg
Copy link
Member

etimberg commented Jan 9, 2018

It's possible to convert those colour scales to a CanvasGradient and then it should render fine. I will see if I can find an example that uses gradients already

@flashpixx
Copy link
Author

I don't have an example yet, but I used it for the borderLine and backgroundColor, so I get a more smooth color flow over my datasets.

@etimberg
Copy link
Member

etimberg commented Jan 9, 2018

One plugin that auto creates gradients is https://github.com/bbc/Chart.bands.js which could be some inspiration.

This is a quick sample I created using a plugin to generate the gradient responsively so that resizing works correctly.

@etimberg
Copy link
Member

etimberg commented Nov 1, 2019

Added a sample file showing how to create gradients and use them in #6666. Turning the color maps into gradients is not a core feature we will support

@etimberg etimberg closed this as completed Nov 1, 2019
@etimberg etimberg added this to the Version 3.0 milestone Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants