# circle-progress **Repository Path**: League2st/circle-progress ## Basic Information - **Project Name**: circle-progress - **Description**: Responsive, accessible, animated, stylable with CSS circular progress bar available as plain (vanilla) JS and jQuery plugin. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2020-04-25 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Circle Progress > Responsive, accessible, animated, stylable with CSS circular progress bar available as plain (vanilla) JavaScript and jQuery plugin.  See [examples][examples] or go to the [project site][site] ## Getting Started ### As plain JavaScript Download the minified [production version][vanilla-min] In your web page: ```html
``` ### As jQuery plugin Download the minified [jQuery production version][jquery-min] In your web page: ```html ``` #### A note about jQuery file jQuery version of Circle Progress is built on top of plain JavaScript version. It uses jQuery Widget Factory. Two files are available: one that contains the Widget Factory code, and one that doesn't. 1. You can use the smaller `jquery.circle-progress.bare.min.js`, if you have already included the jQuery Widget Factory or another native jQuery widget in your page. 1. Otherwise you must use `jquery.circle-progress.min.js`, which includes the jQuery Widget Factory code. ## Usage ### Initiate Circle Progress #### Plain JavaScript ```js const circleProgress = new CircleProgress(element, options, doc); ``` where `element` is HTML element or selector to be converted into a progress circle (required), `options` - object map of options (optional), `doc` - the document we are acting upon (optional). #### jQuery ```js $('.progress').circleProgress(options); ``` where `options` is object map of options (optional). ### Options You can customize Circle Progress with these options by either passing options object at initiation, or setting them later, e. g.: #### In plain js Set options as properties on a CircleProgress instance: ```js circleProgress.max = 100; circleProgress.value = 20; ``` or using the chainable `attr` method by passing it option key and value: ```js circleProgress .attr('max', 100) .attr('value', 20); ``` or options object ```js circleProgress.attr({ max: 100, value: 20, }); ``` #### In jQuery ```js $('.progress').circleProgress('value', 20); ``` or ```js $('.progress').circleProgress({ max: 100, value: 20, }); ``` #### All available options | Option | Type | Default | Description | | ------ | ---- | ------- | ----------- | | value | Number | Indeterminate | Current value | | min | Number | 0 | Minimum value | | max | Number | 1 | Maximum value | | startAngle | Number | 0 | Starting angle in degrees. Angle of 0 points straight up. Direction depends on `clockwise`. | | clockwise | Boolean | true | Whether to rotate clockwise (true) or anti-clockwise (false) | | constrain | Boolean | true | Whether the value should be constrained between `min` and `max`. If true, values over `max` will be truncated to `max` and values under `min` will be set to `min`. | | indeterminateText | String | '?' | Text to display as the value when it is indeterminate | | textFormat | String or Function | 'horizontal' | Text layout for value, min, max.