rendro / easy-pie-chart

easy pie chart is a lightweight plugin to draw simple, animated pie charts for single values
http://rendro.github.io/easy-pie-chart
MIT License
2.07k stars 501 forks source link

Force update to start always from 0 to Value not working: Random 0 value obtained #209

Open djkad opened 4 years ago

djkad commented 4 years ago

// I don't know why, but sometimes it work, sometimes it show 0 // This code is executed by a onclick event, after obtained the "voto" value from an ajax call if ($('#element').data('easyPieChart')!==undefined) { $('#element').data('easyPieChart').update(0);
$('#element').data('easyPieChart').update(voto); } else { $('#element').easyPieChart({ barColor:"#EC7205", trackColor:"#F5F5F5", scaleColor:"#FFF", lineCap:"round", lineWidth:8, size:150, onStep: function(from, to, percent) { $('.easypie-data').html(Math.round(percent)); } }); $('#element').data('easyPieChart').update(voto); }