2016-08-07 14 views
0

http://jsbin.com/nadozi/edit?html,js,outputjQueryのサークルプログレスバーが間違ってここ

を示している私のJSBinです。

円をvalue = 0で初期化しようとしていますが、開始点としてドットが表示されています。 lineCapの場合、の場合にのみ発生します。新鮮なサークルを開始するときに、どのように非表示にして白い灰色の円で始めることができますか?

これは私が使用しようとしているライブラリである。このような https://github.com/kottenator/jquery-circle-progress

+0

はそれを行いますあなたの質問に答えますか? – bhansa

答えて

0

このページのリンクを使用 - 値が0のときにも働いていた描画をバイパスするGitHub - Issue #108

回避策:

drawArc: function(v) { 
    // introduced this value check so that arc is rendered only when value is > 0 
    if (this.getValue() > 0) { 
    var ctx = this.ctx, 
     r = this.radius, 
     t = this.getThickness(), 
     a = this.startAngle; 

    ctx.save(); 
    ctx.beginPath(); 

    if (!this.reverse) { 
     ctx.arc(r, r, r - t/2, a, a + Math.PI * 2 * v); 
    } else { 
     ctx.arc(r, r, r - t/2, a - Math.PI * 2 * v, a); 
    } 

    ctx.lineWidth = t; 
    ctx.lineCap = this.lineCap; 
    ctx.strokeStyle = this.arcFill; 
    ctx.stroke(); 
    ctx.restore(); 
    } 
} 
0

何か?私はより多くの例は、問題が特定され、ここで認められたhttp://kottenator.github.io/jquery-circle-progress/

$('.circle').circleProgress({ 
value: 1.0, 
fill: { color: '#ffa500' } 
}).on('circle-animation-progress', function(event, progress) { 
$(this).find('strong').html(parseInt(100 * progress) + '<i>%</i>'); 
}); 
関連する問題