You can use CSS and conic-gradient for creating donut charts.
Approach:
Create the donut shape using a circular div.
Use conic-gradient to create colored segments in the donut with a white border.
Apply border-radius to give the segments a rounded edge in one direction.
Steps:
HTML:
<div class="donut"></div>
CSS:
.donut {
width: 400px;
height: 400px;
border-radius: 50%; /* Make it circular */
background: conic-gradient(
#ff0000 0% 25%, /* Red segment (25%) */
#00ff00 25% 50%, /* Green segment (25%) */
#0000ff 50% 75%, /* Blue segment (25%) */
#ff00ff 75% 100% /* Purple segment (25%) */
);
border: 20px solid white; /* White border between segments */
background-clip: content-box; /* Ensure the border doesn't overlap the donut */
}