Skip to content

Custom outer shadow on pie/doughnut charts #10115

Answered by LeeLenaleee
alpercun asked this question in Q&A
Discussion options

You must be logged in to vote

Yes you could make a second dataset with the shadow colors and the same values as your original one and then use the onHover config to make them appear or hide (note I used same colors but if you pass in lighter versions it will look more like a shadow):

const options = {
  type: 'doughnut',
  data: {
    labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
    datasets: [{
        label: '# of Votes',
        data: [12, 19, 3, 5, 2, 3],
        backgroundColor: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
        radius: 0
      },
      {
        label: '# of Points',
        data: [12, 19, 3, 5, 2, 3],
        backgroundColor: ["Red", "Blue", "Yellow", "Green", "P…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alpercun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants