"Tabs with Cards and Charts"
Bootstrap 4.1.1 Snippet by drveresh

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/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<script src="//www.jqueryscript.net/demo/Bar-Chart-jQuery-Graphite/graphite.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<br/><br/>
<div class="tabs">
<div class="tab-button-outer">
<ul id="tab-button">
<li><a href="#tab01">Summary</a></li>
<li><a href="#tab02">Clicks</a></li>
<li><a href="#tab03">Geo</a></li>
<li><a href="#tab04">Social</a></li>
</ul>
</div>
<div class="tab-select-outer">
<select id="tab-select">
<option value="#tab01">Tab 1</option>
<option value="#tab02">Tab 2</option>
<option value="#tab03">Tab 3</option>
<option value="#tab04">Tab 4</option>
</select>
</div>
<div id="tab01" class="tab-contents">
<h2>Tab 1</h2>
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="card mb">
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
#container {
width: 100%;
height: 300px;
margin: 0;
padding: 0;
}
body {
font-family: 'Open Sans', sans-serif;
font-weight: 300;
}
.tabs {
max-width: 1000px;
margin: 0 auto;
padding: 0 20px;
}
#tab-button {
display: table;
table-layout: fixed;
width: 100%;
margin: 0;
padding: 0;
list-style: none;
}
#tab-button li {
display: table-cell;
width: 20%;
}
#tab-button li a {
display: block;
padding: .5em;
background: #eee;
border: 1px solid #ddd;
text-align: center;
color: #000;
text-decoration: none;
}
#tab-button li:not(:first-child) a {
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
$(function() {
var $tabButtonItem = $('#tab-button li'),
$tabSelect = $('#tab-select'),
$tabContents = $('.tab-contents'),
activeClass = 'is-active';
$tabButtonItem.first().addClass(activeClass);
$tabContents.not(':first').hide();
$tabButtonItem.find('a').on('click', function(e) {
var target = $(this).attr('href');
$tabButtonItem.removeClass(activeClass);
$(this).parent().addClass(activeClass);
$tabSelect.val(target);
$tabContents.hide();
$(target).show();
e.preventDefault();
});
$tabSelect.on('change', function() {
var target = $(this).val(),
targetSelectNum = $(this).prop('selectedIndex');
$tabButtonItem.removeClass(activeClass);
$tabButtonItem.eq(targetSelectNum).addClass(activeClass);
$tabContents.hide();
$(target).show();
});
//Tab2
anychart.onDocumentReady(function() {
// set the data
var data = {
header: ["Name", "Death toll"],
rows: [
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: