simeydotme / donutty Goto Github PK
View Code? Open in Web Editor NEWCreate SVG donut charts with JavaScript (or jQuery)
Create SVG donut charts with JavaScript (or jQuery)
You mention that the radius can be set to responsive using css. What value needs to be set to make this work?
Hi
amazing library. thanks for your work.
however i ran into an issue with ie11
classList.add is unsupported.
using the polyfill fixed it.
https://developer.mozilla.org/de/docs/Web/API/Element/classList
Would be nice to have this documented or added to the lib.
thanks again for your work.
alex
Hey, thanks for creating Donutty. Really helpful.
I just wanted to bring this to your attention. It would be great if SVGs were accessible. Here's a link to making inline SVGs accessible.
Basically, it would be helpful if there was another option "title" which would be added inside SVG as the first child of its parent as a <title>
tag with a unique ID. Then, <svg>
would also get aria-labelledby
with the unique ID and also role="img"
.
Although not necessary, it would also be helpful if <desc>
was added too. The article explains all of this.
Thanks a lot!
Just thought I'd document some strange display issues on Firefox I ran into. The SVG donut wasn't displaying properly (like it was not fully rendering or being clipped).
Screen recording:
Issue found in Firefox 91, worked ok in other browsers I tested.
It seems related to the transform
attribute on the SVG element.
Overriding the transform attribute by setting transform: scale(1)
on the svg (via my CSS) fixed the issue. Strangely setting transform: none
didn't work.
P.s I was able to replicate the issue somewhat in the codepen demo (didn't occur as often or as badly):
When I tried to concatenate the chart element as a string into a div element using innerHTML property, the chart doesn't renders. I initialized it using CDN.
if a chart is initiated without text
set, then the _this.$text.style.transition
line of code fails and causes unhandled exception
Is anyone working on adding an option to allow for anchoring the track at the top of the donut rather than the bottom?
... on ajax loaded page? I'm using it with data attributes.
Is it possible to add gradient color support for the progress bar?
import 'donutty/dist/donutty';
and how to init?
When using donutty.js
(without jquery) any attempt to initialize donutty will throw an error:
Uncaught TypeError: Cannot read property 'style' of undefined
at win.Donutty.donutty.animate (donutty.js:235)
at win.Donutty.donutty.insertFragments (donutty.js:186)
at win.Donutty.donutty.init (donutty.js:78)
at new win.Donutty (donutty.js:59)
at donutty.js:348
at NodeList.forEach ()
at HTMLDocument.initialise (donutty.js:345)
Even very basic example <div data-donutty></div>
will fail.
It's related to the text
option, which is always false
somehow in that script.
Could that be fixed? You may have a look at my fixed version of donutty.js here: https://www.diffchecker.com/gi42wjgz
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.