Gráfico Circular puro CSS

Developer
Size
2,877 Kb
Views
36,432

How do I make an gráfico circular puro css?

Pie Charts pure CSS. Credits: based and original from Kyle Larson´s blog: http://www.kylejlarson.com/blog/2011/how-to-create-pie-charts-with-css3/. What is a gráfico circular puro css? How do you make a gráfico circular puro css? This script and codes were developed by Kseso on 23 August 2022, Tuesday.

Gráfico Circular puro CSS Previews

Gráfico Circular puro CSS - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Gráfico Circular puro CSS</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ * { box-sizing: border-box;
}
.grafico { height: 200px; margin: 1rem auto; position: relative; width: 200px; }
.recorte { border-radius: 50%; clip: rect(0px, 200px, 200px, 100px); height: 100%; position: absolute; width: 100%; }
.quesito { border-radius: 50%; clip: rect(0px, 100px, 200px, 0px); height: 100%; position: absolute; width: 100%; font-family: monospace; font-size: 1.5rem; }
.sombra { background-color: #fff; border-radius: 50%; box-shadow: 0 4px 7px rgba(0, 0, 0, 0.3); border: 5px solid #000; height: 100%; position: absolute; width: 100%; }
#porcion1 { transform: rotate(0deg); }
#porcion1 .quesito { background-color: rgba(0,0,255,.7); transform: rotate(70deg); }
#porcion2 { transform: rotate(70deg); }
#porcion2 .quesito { background-color: rgba(255,255,0,.7); transform: rotate(120deg); }
#porcion3 { transform: rotate(-170deg); }
#porcion3 .quesito { background-color: rgba(0,128,0,.7); transform: rotate(25deg); }
#porcionFin { transform:rotate(-145deg); }
#porcionFin .quesito { background-color: rgba(255,0,0,.7); transform: rotate(145deg); }
#porcion1 .quesito:after { content: attr(data-rel); left: 25%; line-height: 5; position: absolute; top: 0; transform: rotate(-70deg);
}
#porcion2 .quesito:after { content: attr(data-rel); left: 15%; position: absolute; top: 30%; transform: rotate(-190deg);
}
#porcion3 .quesito:after { content: attr(data-rel); left: 35%; position: absolute; top: 4%; transform: rotate(70deg);
}
#porcionFin .quesito:after { content: attr(data-rel); left: 10%; position: absolute; top: 30%;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="grafico"> <div class="sombra"></div> <div id="porcion1" class="recorte"><div class="quesito" data-rel="70"></div></div> <div id="porcion2" class="recorte"><div class="quesito" data-rel="120"></div></div> <div id="porcion3" class="recorte"><div class="quesito" data-rel="25"></div></div> <div id="porcionFin" class="recorte"><div class="quesito" data-rel="145"></div></div>
</div> <script src="js/index.js"></script>
</body>
</html>

Gráfico Circular puro CSS - Script Codes CSS Codes

* { box-sizing: border-box;
}
.grafico { height: 200px; margin: 1rem auto; position: relative; width: 200px; }
.recorte { border-radius: 50%; clip: rect(0px, 200px, 200px, 100px); height: 100%; position: absolute; width: 100%; }
.quesito { border-radius: 50%; clip: rect(0px, 100px, 200px, 0px); height: 100%; position: absolute; width: 100%; font-family: monospace; font-size: 1.5rem; }
.sombra { background-color: #fff; border-radius: 50%; box-shadow: 0 4px 7px rgba(0, 0, 0, 0.3); border: 5px solid #000; height: 100%; position: absolute; width: 100%; }
#porcion1 { transform: rotate(0deg); }
#porcion1 .quesito { background-color: rgba(0,0,255,.7); transform: rotate(70deg); }
#porcion2 { transform: rotate(70deg); }
#porcion2 .quesito { background-color: rgba(255,255,0,.7); transform: rotate(120deg); }
#porcion3 { transform: rotate(-170deg); }
#porcion3 .quesito { background-color: rgba(0,128,0,.7); transform: rotate(25deg); }
#porcionFin { transform:rotate(-145deg); }
#porcionFin .quesito { background-color: rgba(255,0,0,.7); transform: rotate(145deg); }
#porcion1 .quesito:after { content: attr(data-rel); left: 25%; line-height: 5; position: absolute; top: 0; transform: rotate(-70deg);
}
#porcion2 .quesito:after { content: attr(data-rel); left: 15%; position: absolute; top: 30%; transform: rotate(-190deg);
}
#porcion3 .quesito:after { content: attr(data-rel); left: 35%; position: absolute; top: 4%; transform: rotate(70deg);
}
#porcionFin .quesito:after { content: attr(data-rel); left: 10%; position: absolute; top: 30%;
}

Gráfico Circular puro CSS - Script Codes JS Codes

// Gráfico circular puro css
// Modificación sobre el original de Kyle Larson publicado en su blog:
// "How to Create Pie Charts with CSS3"
// http://www.kylejlarson.com/blog/2011/how-to-create-pie-charts-with-css3/
// Este pen es sólo a efectos de ilustrar un artículo en mi blog.
Gráfico Circular puro CSS - Script Codes
Gráfico Circular puro CSS - Script Codes
Home Page Home
Developer Kseso
Username Kseso
Uploaded August 23, 2022
Rating 3
Size 2,877 Kb
Views 36,432
Do you need developer help for Gráfico Circular puro CSS?

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!

Kseso (Kseso) Script Codes
Create amazing sales emails with AI!

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!