Skip to content

Commit

Permalink
Merge pull request #131 from howard60915/issue/106
Browse files Browse the repository at this point in the history
Issue/106
  • Loading branch information
pguso authored Jun 11, 2017
2 parents 9751774 + 63be544 commit 46ccec1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Options
| percent | can be 1 to 100 | integer | 75 |
| animation | if the circle should be animated initially | int | 1 |
| animationStep | can be 1 to 100, how fast or slow the animation should be | int | 5 |
| progressColor | change color of foreground circle as percents changed({ 50: '#FF6C00', 60: '#FF6C00'}) | {integer:RGB} | null |
| icon | font awesome icon, details bellow | string | none |
| iconSize | font size of the icon | integer | 30 |
| iconColor | color of the icon | RGB | #ccc |
Expand Down
15 changes: 14 additions & 1 deletion js/jquery.circliful.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
decimals: 0,
alwaysDecimals: false,
title: 'Circle Chart',
description: ''
description: '',
progressColor: null
}, options);

return this.each(function () {
Expand All @@ -63,6 +64,7 @@
var elements;
var icon;
var backgroundBorderWidth = settings.backgroundBorderWidth;
var progressColor = settings.progressColor

if (settings.halfCircle) {
if (settings.iconPosition == 'left') {
Expand Down Expand Up @@ -271,6 +273,17 @@
.find('.percent')
.text('');
}

if (progressColor != null) {
$.each(progressColor, function(key, value){
if ( angle >= key * 3.6) {
circle.css({
stroke: value,
transition: 'stroke 0.1s linear'
});
}
});
}
}.bind(circle), interval);
}

Expand Down
2 changes: 1 addition & 1 deletion js/jquery.circliful.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 46ccec1

Please sign in to comment.