I want to reproduce the progress bar in the image below
but I am having trouble with the center image and the text on the side. I am using progressbar.js and this is where I am at right now:
// progressbar.js@1.0.0 version is used
// Docs: http://progressbarjs.readthedocs.org/en/1.0.0/
var bar = new ProgressBar.Circle(container, {
strokeWidth: 20,
easing: 'easeInOut',
duration: 1400,
color: 'url(#gradient)',
trailColor: '#eee',
trailWidth: 1,
svgStyle: null
});
let linearGradient = `
<defs>
<linearGradient id="gradient" x1="100%" y1="0%" x2="0%" y2="0%" gradientUnits="userSpaceOnUse">
<stop offset="20%" stop-color="mediumaquamarine"/>
<stop offset="50%" stop-color="turquoise"/>
</linearGradient>
</defs>
`
let percentage_text = "<span>100%</span>";
bar.svg.insertAdjacentHTML('afterBegin', linearGradient);
bar.svg.insertAdjacentHTML('beforeend', percentage_text);
bar.animate(1.0); // Number from 0.0 to 1.0
#container {
margin: 20px;
width: 200px;
height: 200px;
}
span{
position: absolute;
z-index: 9;
width: 90px;
height: 90px;
color: black;
}
<script src="https://rawgit.com/kimmobrunfeldt/progressbar.js/1.0.0/dist/progressbar.js"></script>
<div id="container"></div>
I have tried inserting the percentage as a span but it doesn't show, for the image I think I can add another div on top of this one with the image in the center but it wouldn't be perfectly centered and might overlap the progress bar.
Any help would go a long way, and if there is another better library to imitate the image it would be perfect. thanks in advance.
