forked from ljb-2000/theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chart-showcase.html
544 lines (504 loc) · 22.3 KB
/
chart-showcase.html
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
<!DOCTYPE html>
<html>
<head>
<title>Detail Admin - Chart Showcase</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- bootstrap -->
<link href="css/bootstrap/bootstrap.css" rel="stylesheet" />
<link href="css/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />
<!-- global styles -->
<link rel="stylesheet" type="text/css" href="css/compiled/layout.css" />
<link rel="stylesheet" type="text/css" href="css/compiled/elements.css" />
<link rel="stylesheet" type="text/css" href="css/compiled/icons.css" />
<!-- libraries -->
<link href="css/lib/jquery-ui-1.10.2.custom.css" rel="stylesheet" type="text/css" />
<link href="css/lib/font-awesome.css" type="text/css" rel="stylesheet" />
<link href="css/lib/morris.css" type="text/css" rel="stylesheet" />
<!-- this page specific styles -->
<link rel="stylesheet" href="css/compiled/chart-showcase.css" type="text/css" media="screen" />
<!-- open sans font -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css' />
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<!-- navbar -->
<header class="navbar navbar-inverse" role="banner">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" id="menu-toggler">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html"><img src="img/logo.png" alt="logo" /></a>
</div>
<ul class="nav navbar-nav pull-right hidden-xs">
<li class="hidden-xs hidden-sm">
<input class="search" type="text" />
</li>
<li class="notification-dropdown hidden-xs hidden-sm">
<a href="#" class="trigger">
<i class="icon-warning-sign"></i>
<span class="count">8</span>
</a>
<div class="pop-dialog">
<div class="pointer right">
<div class="arrow"></div>
<div class="arrow_border"></div>
</div>
<div class="body">
<a href="#" class="close-icon"><i class="icon-remove-sign"></i></a>
<div class="notifications">
<h3>You have 6 new notifications</h3>
<a href="#" class="item">
<i class="icon-signin"></i> New user registration
<span class="time"><i class="icon-time"></i> 13 min.</span>
</a>
<a href="#" class="item">
<i class="icon-signin"></i> New user registration
<span class="time"><i class="icon-time"></i> 18 min.</span>
</a>
<a href="#" class="item">
<i class="icon-envelope-alt"></i> New message from Alejandra
<span class="time"><i class="icon-time"></i> 28 min.</span>
</a>
<a href="#" class="item">
<i class="icon-signin"></i> New user registration
<span class="time"><i class="icon-time"></i> 49 min.</span>
</a>
<a href="#" class="item">
<i class="icon-download-alt"></i> New order placed
<span class="time"><i class="icon-time"></i> 1 day.</span>
</a>
<div class="footer">
<a href="#" class="logout">View all notifications</a>
</div>
</div>
</div>
</div>
</li>
<li class="notification-dropdown hidden-xs hidden-sm">
<a href="#" class="trigger">
<i class="icon-envelope"></i>
</a>
<div class="pop-dialog">
<div class="pointer right">
<div class="arrow"></div>
<div class="arrow_border"></div>
</div>
<div class="body">
<a href="#" class="close-icon"><i class="icon-remove-sign"></i></a>
<div class="messages">
<a href="#" class="item">
<img src="img/contact-img.png" class="display" alt="user" />
<div class="name">Alejandra Galván</div>
<div class="msg">
There are many variations of available, but the majority have suffered alterations.
</div>
<span class="time"><i class="icon-time"></i> 13 min.</span>
</a>
<a href="#" class="item">
<img src="img/contact-img2.png" class="display" alt="user" />
<div class="name">Alejandra Galván</div>
<div class="msg">
There are many variations of available, have suffered alterations.
</div>
<span class="time"><i class="icon-time"></i> 26 min.</span>
</a>
<a href="#" class="item last">
<img src="img/contact-img.png" class="display" alt="user" />
<div class="name">Alejandra Galván</div>
<div class="msg">
There are many variations of available, but the majority have suffered alterations.
</div>
<span class="time"><i class="icon-time"></i> 48 min.</span>
</a>
<div class="footer">
<a href="#" class="logout">View all messages</a>
</div>
</div>
</div>
</div>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle hidden-xs hidden-sm" data-toggle="dropdown">
Your account
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="personal-info.html">Personal info</a></li>
<li><a href="#">Account settings</a></li>
<li><a href="#">Billing</a></li>
<li><a href="#">Export your data</a></li>
<li><a href="#">Send feedback</a></li>
</ul>
</li>
<li class="settings hidden-xs hidden-sm">
<a href="personal-info.html" role="button">
<i class="icon-cog"></i>
</a>
</li>
<li class="settings hidden-xs hidden-sm">
<a href="signin.html" role="button">
<i class="icon-share-alt"></i>
</a>
</li>
</ul>
</header>
<!-- end navbar -->
<!-- sidebar -->
<div id="sidebar-nav">
<ul id="dashboard-menu">
<li>
<a href="index.html">
<i class="icon-home"></i>
<span>Home</span>
</a>
</li>
<li class="active">
<a href="chart-showcase.html">
<div class="pointer">
<div class="arrow"></div>
<div class="arrow_border"></div>
</div>
<i class="icon-signal"></i>
<span>Charts</span>
</a>
</li>
<li>
<a class="dropdown-toggle" href="#">
<i class="icon-group"></i>
<span>Users</span>
<i class="icon-chevron-down"></i>
</a>
<ul class="submenu">
<li><a href="user-list.html">User list</a></li>
<li><a href="new-user.html">New user form</a></li>
<li><a href="user-profile.html">User profile</a></li>
</ul>
</li>
<li>
<a class="dropdown-toggle" href="#">
<i class="icon-edit"></i>
<span>Forms</span>
<i class="icon-chevron-down"></i>
</a>
<ul class="submenu">
<li><a href="form-showcase.html">Form showcase</a></li>
<li><a href="form-wizard.html">Form wizard</a></li>
</ul>
</li>
<li>
<a href="gallery.html">
<i class="icon-picture"></i>
<span>Gallery</span>
</a>
</li>
<li>
<a href="calendar.html">
<i class="icon-calendar-empty"></i>
<span>Calendar</span>
</a>
</li>
<li>
<a class="dropdown-toggle" href="tables.html">
<i class="icon-th-large"></i>
<span>Tables</span>
<i class="icon-chevron-down"></i>
</a>
<ul class="submenu">
<li><a href="tables.html">Custom tables</a></li>
<li><a href="datatables.html">DataTables</a></li>
</ul>
</li>
<li>
<a class="dropdown-toggle ui-elements" href="#">
<i class="icon-code-fork"></i>
<span>UI Elements</span>
<i class="icon-chevron-down"></i>
</a>
<ul class="submenu">
<li><a href="ui-elements.html">UI Elements</a></li>
<li><a href="icons.html">Icons</a></li>
</ul>
</li>
<li>
<a href="personal-info.html">
<i class="icon-cog"></i>
<span>My Info</span>
</a>
</li>
<li>
<a class="dropdown-toggle" href="#">
<i class="icon-share-alt"></i>
<span>Extras</span>
<i class="icon-chevron-down"></i>
</a>
<ul class="submenu">
<li><a href="code-editor.html">Code editor</a></li>
<li><a href="grids.html">Grids</a></li>
<li><a href="signin.html">Sign in</a></li>
<li><a href="signup.html">Sign up</a></li>
</ul>
</li>
</ul>
</div>
<!-- end sidebar -->
<!-- main container -->
<div class="content">
<!-- settings changer -->
<div class="skins-nav">
<a href="#" class="skin first_nav selected">
<span class="icon"></span><span class="text">Default</span>
</a>
<a href="#" class="skin second_nav" data-file="css/compiled/skins/dark.css">
<span class="icon"></span><span class="text">Dark skin</span>
</a>
</div>
<div id="pad-wrapper">
<!-- morris stacked chart -->
<div class="row">
<div class="col-md-12">
<h4 class="title">Morris.js stacked</h4>
</div>
<div class="col-md-12">
<h5>Quarterly Apple iOS device unit sales</h5>
<br>
<div id="hero-area" style="height: 250px;"></div>
</div>
</div>
<!-- morris graph chart -->
<div class="row section">
<div class="col-md-12">
<h4 class="title">Morris.js <small>Monthly growth</small></h4>
</div>
<div class="col-md-12 chart">
<div id="hero-graph" style="height: 230px;"></div>
</div>
</div>
<!-- jQuery flot chart -->
<div class="row section">
<div class="col-md-12">
<h4 class="title pull-left">
jQuery Flot <small>Monthly growth</small>
</h4>
<div class="btn-group pull-right">
<button class="glow left">DAY</button>
<button class="glow middle active">MONTH</button>
<button class="glow right">YEAR</button>
</div>
</div>
<div class="span12">
<div id="statsChart"></div>
</div>
</div>
<!-- morris bar & donut charts -->
<div class="row section">
<div class="col-md-12">
<h4 class="title">Morris.js</h4>
</div>
<div class="col-md-6 chart">
<h5>Devices sold</h5>
<div id="hero-bar" style="height: 250px;"></div>
</div>
<div class="col-md-5 chart">
<h5>Month traffic</h5>
<div id="hero-donut" style="height: 250px;"></div>
</div>
</div>
<!-- jQuery knobs -->
<div class="row section">
<div class="col-md-12">
<h4 class="title">jQuery Knob</h4>
</div>
<div class="row">
<div class="col-md-3">
<input type="text" value="50" class="knob second" data-thickness=".3" data-inputColor="#333" data-fgColor="#30a1ec" data-bgColor="#d4ecfd" data-width="140">
</div>
<div class="col-md-3">
<input type="text" value="75" class="knob second" data-thickness=".3" data-inputColor="#333" data-fgColor="#8ac368" data-bgColor="#c4e9aa" data-width="140">
</div>
<div class="col-md-3">
<input type="text" value="35" class="knob second" data-thickness=".3" data-inputColor="#333" data-fgColor="#5ba0a3" data-bgColor="#cef3f5" data-width="140">
</div>
<div class="col-md-3">
<input type="text" value="85" class="knob second" data-thickness=".3" data-inputColor="#333" data-fgColor="#b85e80" data-bgColor="#f8d2e0" data-width="140">
</div>
</div>
</div>
</div>
</div>
<!-- end main container -->
<!-- scripts for this page -->
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery-ui-1.10.2.custom.min.js"></script>
<!-- knob -->
<script src="js/jquery.knob.js"></script>
<!-- flot charts -->
<script src="js/jquery.flot.js"></script>
<script src="js/jquery.flot.stack.js"></script>
<script src="js/jquery.flot.resize.js"></script>
<!-- morrisjs -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="js/morris.min.js"></script>
<!-- call all plugins -->
<script src="js/theme.js"></script>
<!-- build the charts -->
<script type="text/javascript">
// Morris Bar Chart
Morris.Bar({
element: 'hero-bar',
data: [
{device: '1', sells: 136},
{device: '3G', sells: 1037},
{device: '3GS', sells: 275},
{device: '4', sells: 380},
{device: '4S', sells: 655},
{device: '5', sells: 1571}
],
xkey: 'device',
ykeys: ['sells'],
labels: ['Sells'],
barRatio: 0.4,
xLabelMargin: 10,
hideHover: 'auto',
barColors: ["#3d88ba"]
});
// Morris Donut Chart
Morris.Donut({
element: 'hero-donut',
data: [
{label: 'Direct', value: 25 },
{label: 'Referrals', value: 40 },
{label: 'Search engines', value: 25 },
{label: 'Unique visitors', value: 10 }
],
colors: ["#30a1ec", "#76bdee", "#c4dafe"],
formatter: function (y) { return y + "%" }
});
// Morris Line Chart
var tax_data = [
{"period": "2013-04", "visits": 2407, "signups": 660},
{"period": "2013-03", "visits": 3351, "signups": 729},
{"period": "2013-02", "visits": 2469, "signups": 1318},
{"period": "2013-01", "visits": 2246, "signups": 461},
{"period": "2012-12", "visits": 3171, "signups": 1676},
{"period": "2012-11", "visits": 2155, "signups": 681},
{"period": "2012-10", "visits": 1226, "signups": 620},
{"period": "2012-09", "visits": 2245, "signups": 500}
];
Morris.Line({
element: 'hero-graph',
data: tax_data,
xkey: 'period',
xLabels: "month",
ykeys: ['visits', 'signups'],
labels: ['Visits', 'User signups']
});
// Morris Area Chart
Morris.Area({
element: 'hero-area',
data: [
{period: '2010 Q1', iphone: 2666, ipad: null, itouch: 2647},
{period: '2010 Q2', iphone: 2778, ipad: 2294, itouch: 2441},
{period: '2010 Q3', iphone: 4912, ipad: 1969, itouch: 2501},
{period: '2010 Q4', iphone: 3767, ipad: 3597, itouch: 5689},
{period: '2011 Q1', iphone: 6810, ipad: 1914, itouch: 2293},
{period: '2011 Q2', iphone: 5670, ipad: 4293, itouch: 1881},
{period: '2011 Q3', iphone: 4820, ipad: 3795, itouch: 1588},
{period: '2011 Q4', iphone: 15073, ipad: 5967, itouch: 5175},
{period: '2012 Q1', iphone: 10687, ipad: 4460, itouch: 2028},
{period: '2012 Q2', iphone: 8432, ipad: 5713, itouch: 1791}
],
xkey: 'period',
ykeys: ['iphone', 'ipad', 'itouch'],
labels: ['iPhone', 'iPad', 'iPod Touch'],
lineWidth: 2,
hideHover: 'auto',
lineColors: ["#81d5d9", "#a6e182", "#67bdf8"]
});
// Build jQuery Knobs
$(".knob").knob();
// jQuery Flot Chart
var visits = [[1, 50], [2, 40], [3, 45], [4, 23],[5, 55],[6, 65],[7, 61],[8, 70],[9, 65],[10, 75],[11, 57],[12, 59]];
var visitors = [[1, 25], [2, 50], [3, 23], [4, 48],[5, 38],[6, 40],[7, 47],[8, 55],[9, 43],[10,50],[11,47],[12, 39]];
var plot = $.plot($("#statsChart"),
[ { data: visits, label: "Signups"},
{ data: visitors, label: "Visits" }], {
series: {
lines: { show: true,
lineWidth: 1,
fill: true,
fillColor: { colors: [ { opacity: 0.05 }, { opacity: 0.09 } ] }
},
points: { show: true,
lineWidth: 2,
radius: 3
},
shadowSize: 0,
stack: true
},
grid: { hoverable: true,
clickable: true,
tickColor: "#f9f9f9",
borderWidth: 0
},
legend: {
// show: false
labelBoxBorderColor: "#fff"
},
colors: ["#a7b5c5", "#30a0eb"],
xaxis: {
ticks: [[1, "JAN"], [2, "FEB"], [3, "MAR"], [4,"APR"], [5,"MAY"], [6,"JUN"],
[7,"JUL"], [8,"AUG"], [9,"SEP"], [10,"OCT"], [11,"NOV"], [12,"DEC"]],
font: {
size: 12,
family: "Open Sans, Arial",
variant: "small-caps",
color: "#9da3a9"
}
},
yaxis: {
ticks:3,
tickDecimals: 0,
font: {size:12, color: "#9da3a9"}
}
});
function showTooltip(x, y, contents) {
$('<div id="tooltip">' + contents + '</div>').css( {
position: 'absolute',
display: 'none',
top: y - 30,
left: x - 50,
color: "#fff",
padding: '2px 5px',
'border-radius': '6px',
'background-color': '#000',
opacity: 0.80
}).appendTo("body").fadeIn(200);
}
var previousPoint = null;
$("#statsChart").bind("plothover", function (event, pos, item) {
if (item) {
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
$("#tooltip").remove();
var x = item.datapoint[0].toFixed(0),
y = item.datapoint[1].toFixed(0);
var month = item.series.xaxis.ticks[item.dataIndex].label;
showTooltip(item.pageX, item.pageY,
item.series.label + " of " + month + ": " + y);
}
}
else {
$("#tooltip").remove();
previousPoint = null;
}
});
</script>
</body>
</html>