My animated pie chart created with inline SVG code is functioning well on Chrome, Firefox, and Safari browsers. However, it encounters issues in Internet Explorer where the SVG expands vertically and generates a duplicate background element inside the SVG instead of just the circle. I attempted using the preserveAspectRatio attribute but it did not resolve the problem. See snippet below:
var chart = '<svg viewBox="0 0 32 32"><circle class="circle" r="16" cx="16" cy="16" style="stroke-dasharray: 0 100" /></svg>';
$('.pie__container--chart').html(chart);
var chart = $('.pie__container--chart circle');
setTimeout(function () {
chart.css('stroke-dasharray', 30 + ' 100');
$('.pie__container--percent').css('opacity', '1');
}, 500);
jQuery('button').mouseover(function() {
num = $(this).attr('data-val');
$('.pie__container--percent').text(num + '%').addClass('animated');
setTimeout(function () {
$('.pie__container--percent').removeClass('animated');
}, 500);
chart.css('stroke-dasharray', num + ' 100');
$('button').not(this).removeClass('active');
$(this).addClass('active');
});
/* CSS Code Snippet */
/* JavaScript Code Snippet */