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

arcColor #80

Open
ShitalUnde opened this issue Mar 4, 2022 · 1 comment
Open

arcColor #80

ShitalUnde opened this issue Mar 4, 2022 · 1 comment

Comments

@ShitalUnde
Copy link

arcColors: ['linear-gradient(red,yellow,orange)'],

its not working

@djungowski
Copy link

djungowski commented Mar 15, 2022

That is because it's not a color per se and gradients in SVG work differently, see this Stackoverflow post for reference

The gauge-chart code itself does this:

    let innerArc = svg
      .append('path')
      .attr('d', gaugeArc)
      .attr('fill', color)
      .attr(
        'transform',
        'translate(' +
          (chartHeight + offset * 2) +
          ', ' +
          (chartHeight + offset) +
          ')',
      )

fill itself takes a <paint> type as param, see this MDN page for reference (also follow the link to the paint definition, there you'll see what you can actually pass to fill).

I do not have a solution right now, as I'm struggling with the exact same problem 😅

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

2 participants