Skip to content
Advertisement

Change Jquery asPieProgress barcolor at run time

I am using Jquery asPieProgress plugin: https://github.com/thecreation/jquery-asPieProgress#options.

I have a situation in which I have to change bar color of it depending upon a value. I tired below but none of that works:

$('#id').asPieProgress({barcolor: '#2e7d32'});

$('#id').asPieProgress({data-barcolor: '#2e7d32'});

$('#id').attr('data-barcolor', '#e53935');

$('#id').attr('barcolor', '#e53935');

Any help/suggestions will be highly appreciated.

Advertisement

Answer

I fixed it by giving the style on svg path element directly like below:

$(‘#id .pie-progress-svg svg path’).attr(“stroke”, “#f44336”);

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement