I have donut which is made in svg. I want to upgrade it to semi donut somehow.
.donut-ring {
stroke: #EBEBEB;
}
.donut-segment-2 {
stroke: green;
animation: donut 1s;
}
@keyframes donut {
0% {
stroke-dasharray: 0, 100;
}
100% {
stroke-dasharray: 25, 75;
}
}
<svg width="100%" height="100%" viewBox="0 0 40 40" class="donut">
<circle class="donut-hole" cx="20" cy="20" r="15.91549430918954" fill="#fff"></circle>
<circle class="donut-ring" cx="20" cy="20" r="15.91549430918954" fill="transparent" stroke-width="3.5"></circle>
<circle class="donut-segment donut-segment-2" cx="20" cy="20" r="15.91549430918954" fill="transparent" stroke-width="3.5" stroke-dasharray="25 75" stroke-dashoffset="50"></circle>
</svg>
2
Answers
Just clip away what you don’t want to see.
I wrote a small Web Component to do Pie Charts: https://pie-meister.github.io/
With some extra CSS everyone who can do HTML can create a chart: