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

2 color or gradient color in donut charts #6118

Closed
ashishbhattb opened this issue Mar 7, 2019 · 4 comments
Closed

2 color or gradient color in donut charts #6118

ashishbhattb opened this issue Mar 7, 2019 · 4 comments
Milestone

Comments

@ashishbhattb
Copy link

Expected Behavior

https://i.imgur.com/r6q5Zwi.png

Current Behavior

https://jsfiddle.net/ashishbhatt/wnzsdgp3/20/

Possible Solution

I needs a background with 2 color or gradient, as now i am not able to add 2 colors or gradient colors

Steps to Reproduce (for bugs)

I am trying to add below script

Environment

  • Chart.js version: Chart.js v2.8.0-rc.1
  • Browser name and version: Chrome
  • Link to your project:
@benmccann
Copy link
Contributor

You could perhaps draw two datasets next to each other with different colors to get the same effect

@ashishbhattb
Copy link
Author

Thanks @benmccann ,
going ahead i was stuck for the click events of the legends
https://jsfiddle.net/ashishbhatt/wnzsdgp3/29/
Issue: i want to animate both the dataset if user click on legends but as now its animating only 1st dataset
Please help me for the same.

@etimberg
Copy link
Member

Another option here is to create a Radial Gradient and assign that as the background color for each arc.

@etimberg
Copy link
Member

etimberg commented Nov 1, 2019

Added a sample file showing how to do this in #6666

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants