Help to change bar color of Easy Pie Chart with click event
I'm using
Easy Pie Chart and this is working well with the following code:
- $('.chart').easyPieChart({
- size: '150',
- easing: 'easeOutBounce',
- barColor : $(".cbg").css("backgroundColor"),
- onStep: function(from, to, percent){
- $(this.el).find('.percent').text(Math.round(percent));
- }
- });
I've a color switcher that switches the color of my theme. Now I want to switch the color of the bar with the color of the theme. So I write the following code. But it is not working.
- $("#switcher span").click(function(){
- $('.chart').easyPieChart({
- size: '150',
- easing: 'easeOutBounce',
- barColor : $(this).css("backgroundColor"),
- onStep: function(from, to, percent){
- $(this.el).find('.percent').text(Math.round(percent));
- }
- });
- });
Could anybody help me? Thanks in advance.