Plugin to draw animated circular progress bars
npm install jquery-circle-progressjquery-circle-progress
======================



jQuery Plugin to draw animated circular progress bars like this:

Check out more examples! Or maybe the crazy one?
Install
-------
Make your choice:
* Download latest GitHub release
* bower install jquery-circle-progress
* npm install jquery-circle-progress
Usage
-----
``html
`
If you use AMD or CommonJS with some JS bundler - see the UMD section below.
Options
-------
Specify options like in example above.
| Option | Description |
| ---- | ---- |
| value | This is the only required option. It should be from 0.0 to 1.0 0
Default: |100
| size | Size of the circle / canvas in pixels
Default: |0
| startAngle | Initial angle (for value) -Math.PI
Default: |false
| reverse | Reverse animation and arc draw
Default: |size
| thickness | Width of the arc. By default it's automatically calculated as 1/14 of but you may set your own number "auto"
Default: |"butt"
| lineCap | Arc line cap: , "round" or "square" - read more "butt"
Default: "#ff1e41"
| fill | The arc fill config. You may specify next:
- { color: "#ff1e41" }
- { color: 'rgba(255, 255, 255, .3)' }
- { gradient: ["red", "green", "blue"] }
- { gradient: [["red", .2], ["green", .3], ["blue", .8]] }
- { gradient: [ ... ], gradientAngle: Math.PI / 4 }
- { gradient: [ ... ], gradientDirection: [x0, y0, x1, y1] }
- { image: "http://i.imgur.com/pT0i89v.png" }
- { image: imageInstance }
- { color: "lime", image: "http://i.imgur.com/pT0i89v.png" }
- { gradient: ["#3aeabb", "#fdd250"] }
Default: |"rgba(0, 0, 0, .1)"
| emptyFill | Color of the "empty" arc. Only a color fill supported by now
Default: |false
| animation | Animation config. See jQuery animations.
You may also set it to { duration: 1200, easing: "circleProgressEase" }
Default: "circleProgressEase"
is just a ease-in-out-cubic easing |0.0
| animationStartValue | Default animation starts at and ends at specified value. Let's call this direct animation. If you want to make reversed animation then you should set animationStartValue to 1.0. Also you may specify any other value from 0.0 to 1.0 0.0
Default: "prepend"
| insertMode | Canvas insertion mode: append or prepend it into the parent element?
Default: |
From version 1.1.3 you can specify any config option as HTML data- attribute.
It will work only on init, i.e. after the widget is inited you may update its properties only via .circleProgress({/.../}) method. data- attributes will be ignored.
Also, object options like "fill" or "animation" should be valid JSON (and don't forget about HTML-escaping):
`html
class="circle"
data-value="0.9"
data-size="60"
data-thickness="20"
data-animation-start-value="1.0"
data-fill="{
"color": "rgba(0, 0, 0, .3)",
"image": "http://i.imgur.com/pT0i89v.png"
}"
data-reverse="true"
>
Events
------
| Event | Description | Handler |
| ---- | ---- | ---- |
|
circle-inited | Triggered on init or re-init. | function(event):
- event - jQuery event |
| circle-animation-start | Triggered once the animation is started. | function(event):
- event - jQuery event |
| circle-animation-progress | Triggered on each animation tick. | function(event, animationProgress, stepValue):
- event - jQuery event
- animationProgress - from 0.0 to 1.0
- stepValue - current step value: from 0.0 to value |
| circle-animation-end | Triggered once the animation is finished. | function(event):
- event - jQuery event |Browsers support
----------------
The library uses