// 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);
}
// 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); }