Skip to content

Commit 46ccec1

Browse files
authored
Merge pull request #131 from howard60915/issue/106
Issue/106
2 parents 9751774 + 63be544 commit 46ccec1

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Options
6464
| percent | can be 1 to 100 | integer | 75 |
6565
| animation | if the circle should be animated initially | int | 1 |
6666
| animationStep | can be 1 to 100, how fast or slow the animation should be | int | 5 |
67+
| progressColor | change color of foreground circle as percents changed({ 50: '#FF6C00', 60: '#FF6C00'}) | {integer:RGB} | null |
6768
| icon | font awesome icon, details bellow | string | none |
6869
| iconSize | font size of the icon | integer | 30 |
6970
| iconColor | color of the icon | RGB | #ccc |

js/jquery.circliful.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
decimals: 0,
4747
alwaysDecimals: false,
4848
title: 'Circle Chart',
49-
description: ''
49+
description: '',
50+
progressColor: null
5051
}, options);
5152

5253
return this.each(function () {
@@ -63,6 +64,7 @@
6364
var elements;
6465
var icon;
6566
var backgroundBorderWidth = settings.backgroundBorderWidth;
67+
var progressColor = settings.progressColor
6668

6769
if (settings.halfCircle) {
6870
if (settings.iconPosition == 'left') {
@@ -271,6 +273,17 @@
271273
.find('.percent')
272274
.text('');
273275
}
276+
277+
if (progressColor != null) {
278+
$.each(progressColor, function(key, value){
279+
if ( angle >= key * 3.6) {
280+
circle.css({
281+
stroke: value,
282+
transition: 'stroke 0.1s linear'
283+
});
284+
}
285+
});
286+
}
274287
}.bind(circle), interval);
275288
}
276289

js/jquery.circliful.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)