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

[Suggestion] using css radial-gradient instead of creating elements for sections #3

Open
avrahamcool opened this issue Jul 9, 2020 · 2 comments

Comments

@avrahamcool
Copy link
Contributor

you can simplify your current implementation, by removing the creation of sections as elements in the DOM.
(because then you need to actually style them, rotate them etc.)

you can use the css radial-gradient property (it even has very good browser support)
to style a single DOM element in the desired pie/ring effect, by using multiple stops (of different sizes) on the same linear gradient.

a demo of how its done can be seen here: https://bennettfeely.com/csspiechart/

@stal269
Copy link
Owner

stal269 commented Jul 11, 2020

Thanks for the feedback :) I see in the demo that the conic-gradient should be used with the radial-gradient, but conic-gradient isn't supported on Firefox :(

@yktoo
Copy link

yktoo commented Sep 22, 2021

As far as I can see, Firefox has had support for conic-gradient from version 83 on.

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