CSS Donut Charts
How do I make an css donut charts?
What is a css donut charts? How do you make a css donut charts? This script and codes were developed by Sean Stopnik on 21 December 2022, Wednesday.
CSS Donut Charts - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CSS Donut Charts</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="card"> <div class="donut-chart chart1"> <div class="slice one"></div> <div class="slice two"></div> <div class="chart-center"> <span></span> </div> </div>
</div>
<div class="card"> <div class="donut-chart chart2"> <div class="slice one"></div> <div class="slice two"></div> <div class="chart-center"> <span></span> </div> </div>
</div>
<div class="card"> <div class="donut-chart chart3"> <div class="slice one"></div> <div class="slice two"></div> <div class="chart-center"> <span></span> </div> </div>
</div>
<div class="card"> <div class="donut-chart chart4"> <div class="slice one"></div> <div class="slice two"></div> <div class="chart-center"> <span></span> </div> </div>
</div>
</body>
</html>
CSS Donut Charts - Script Codes CSS Codes
* { -webkit-box-sizing: border-box; box-sizing: border-box;
}
body { font-family: sans-serif; background: #e1e1e1;
}
.card { float: left; background: #fff; padding: 20px; margin: 0 20px 0 0;
}
.donut-chart { position: relative; border-radius: 50%; overflow: hidden;
}
.donut-chart .slice { position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}
.donut-chart .chart-center { position: absolute; border-radius: 50%;
}
.donut-chart .chart-center span { display: block; text-align: center;
}
.donut-chart.chart1 { width: 200px; height: 200px; background: #e1e1e1;
}
.donut-chart.chart1 .slice.one { clip: rect(0 200px 100px 0); -webkit-transform: rotate(90deg); transform: rotate(90deg); background: #50c690;
}
.donut-chart.chart1 .slice.two { clip: rect(0 100px 200px 0); -webkit-transform: rotate(270deg); transform: rotate(270deg); background: #50c690;
}
.donut-chart.chart1 .chart-center { top: 10px; left: 10px; width: 180px; height: 180px; background: #fff;
}
.donut-chart.chart1 .chart-center span { font-size: 40px; line-height: 180px; color: #50c690;
}
.donut-chart.chart1 .chart-center span:after { content: "75%";
}
.donut-chart.chart2 { width: 200px; height: 200px; background: #e1e1e1;
}
.donut-chart.chart2 .slice.one { clip: rect(0 200px 100px 0); -webkit-transform: rotate(90deg); transform: rotate(90deg); background: #48b2c1;
}
.donut-chart.chart2 .slice.two { clip: rect(0 100px 200px 0); -webkit-transform: rotate(327.6deg); transform: rotate(327.6deg); background: #48b2c1;
}
.donut-chart.chart2 .chart-center { top: 25px; left: 25px; width: 150px; height: 150px; background: #fff;
}
.donut-chart.chart2 .chart-center span { font-size: 40px; line-height: 150px; color: #48b2c1;
}
.donut-chart.chart2 .chart-center span:after { content: "91%";
}
.donut-chart.chart3 { width: 120px; height: 120px; background: #353535;
}
.donut-chart.chart3 .slice.one { clip: rect(0 120px 60px 0); -webkit-transform: rotate(144deg); transform: rotate(144deg); background: #e1e1e1;
}
.donut-chart.chart3 .slice.two { clip: rect(0 60px 120px 0); -webkit-transform: rotate(0deg); transform: rotate(0deg); background: #e1e1e1;
}
.donut-chart.chart3 .chart-center { top: 5px; left: 5px; width: 110px; height: 110px; background: #fff;
}
.donut-chart.chart3 .chart-center span { font-size: 40px; line-height: 110px; color: #353535;
}
.donut-chart.chart3 .chart-center span:after { content: "15%";
}
.donut-chart.chart4 { width: 240px; height: 240px; background: #f26a4a;
}
.donut-chart.chart4 .slice.one { clip: rect(0 240px 120px 0); -webkit-transform: rotate(252deg); transform: rotate(252deg); background: #e1e1e1;
}
.donut-chart.chart4 .slice.two { clip: rect(0 120px 240px 0); -webkit-transform: rotate(0deg); transform: rotate(0deg); background: #e1e1e1;
}
.donut-chart.chart4 .chart-center { top: 15px; left: 15px; width: 210px; height: 210px; background: #fff;
}
.donut-chart.chart4 .chart-center span { font-size: 60px; line-height: 210px; color: #f26a4a;
}
.donut-chart.chart4 .chart-center span:after { content: "45%";
}
Developer | Sean Stopnik |
Username | seanstopnik |
Uploaded | December 21, 2022 |
Rating | 4 |
Size | 2,908 Kb |
Views | 28,336 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Simple Slider Effect in CSS - Vertical | 3,183 Kb |
A Pen by Sean Stopnik | 2,673 Kb |
Inputs with Add-ons | 2,620 Kb |
Save to Favorites | 3,395 Kb |
Modular Sass Animation Library | 4,142 Kb |
CSS Range Slider | 3,218 Kb |
Photo Card | 4,287 Kb |
Simple Accordian | 2,995 Kb |
CSS Tooltip | 3,058 Kb |
Orbiting Dots | 2,371 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Sassy Buttons | Elyseholladay | 2,299 Kb |
Apple website | Jds317 | 1,835 Kb |
LeMandinque | Aadesida | 9,046 Kb |
Twitch.tv API | Ryzokuken | 2,618 Kb |
Simple Linear Regression with Editable Table | Melatonind | 3,264 Kb |
Project MMetro beta | Atomicsong | 5,157 Kb |
A Pen by Paul Sullivan | Pwsm50 | 2,349 Kb |
Preloader | Rikki_Sixx | 2,815 Kb |
Tic Tac Toe | Volv | 4,862 Kb |
Bootstrap example | Ssaakkaa | 2,716 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!