Skip to content

Instantly share code, notes, and snippets.

@tkh44
Created October 8, 2012 18:26
Show Gist options
  • Save tkh44/3854063 to your computer and use it in GitHub Desktop.
Save tkh44/3854063 to your computer and use it in GitHub Desktop.
Trying to get a working model of a pie chart type model of a statistic.
<div class="pieContainer">
<div class="pieBackground">
</div>
<div id="pieSlice1" class="hold">
<div class="pie">
</div>
</div>
<div class="stat-circle-cover">
<span class="stat-number">
25%
</span>
</div>
</div>
.pieContainer {
height: 100px;
width: 100px;
position: relative;
}
.pieBackground{
background-color: #333;
position: absolute;
height: 100px;
width: 100px;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
border-radius: 50px;
}
.pie {
position: absolute;
height: 100px;
width: 100px;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
border-radius: 50px;
clip: rect(0px, 50px, 100px, 0px);
}
.hold {
position: absolute;
width: 100px;
height: 100px;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
border-radius: 50px;
clip: rect(0px, 100px, 100px, 50px);
}
#pieSlice1 .pie {
background-color: #09b036;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
.stat-circle-cover {
position: absolute;
top: 5%;
right: 5%;
background-color: #333;
height: 90%;
width: 90%;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
}
.stat-circle-cover span.stat-number {
text-align: center;
color: #f78e1e;
position: absolute;
top: 25%;
left: 15%;
font-size: 35px;
font-family: Helvetica-Neue, Helvetica, arial, verdana, sans-serif;
font-weight: bold;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment