"Responsive Column Chart"
Bootstrap 3.3.0 Snippet by ajayhanda

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="text-center text-uppercase">
<h2>My Strengths</h2>
</div>
<!-- //.text-center -->
<div class="column-chart">
<div class="legend legend-left hidden-xs">
<h3 class="legend-title">ME</h3>
</div>
<!-- //.legend -->
<div class="legend legend-right hidden-xs">
<div class="item">
<h4>Superhero</h4>
</div>
<!-- //.item -->
<div class="item">
<h4>Preety Good</h4>
</div>
<!-- //.item -->
<div class="item">
<h4>Good</h4>
</div>
<!-- //.item -->
<div class="item">
<h4>Newbie</h4>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@import url(https://fonts.googleapis.com/css?family=Roboto);
body {
background-color: #f2f2f2;
color: #000;
font-family: 'Roboto', sans-serif;
}
.column-chart {
position: relative;
z-index: 20;
bottom: 0;
left: 50%;
width: 100%;
height: 320px;
margin-top: 40px;
margin-left: -50%;
}
@media (min-width: 568px) {
.column-chart {
width: 80%;
margin-left: -40%;
}
}
@media (min-width: 768px) {
.column-chart {
width: 60%;
margin-left: -30%;
}
}
@media (min-width: 992px) {
.column-chart {
width: 40%;
margin-left: -20%;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$(document).ready(function(){
columnChart();
function columnChart(){
var item = $('.chart', '.column-chart').find('.item'),
itemWidth = 100 / item.length;
item.css('width', itemWidth + '%');
$('.column-chart').find('.item-progress').each(function(){
var itemProgress = $(this),
itemProgressHeight = $(this).parent().height() * ($(this).data('percent') / 100);
itemProgress.css('height', itemProgressHeight);
});
};
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: