I inserted some animated pie charts on my page, but I wish the animation was only started when the DIV that contains these graphics was displayed on the screen, would anyone know how to do it?
The following animation should be started when the DIV with the graphics is visible:
$('#pie-one,#pie-two,#pie-tree').pieChart({
barColor: '#21d927',
trackColor: '#eee',
lineCap: 'square',
lineWidth: 18,
onStep: function (from, to, percent) {
$(this.element).find('.pie-value').text(Math.round(percent) + '%');
}
});
Thank you.