chartjs.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>AdminLTE 2 | ChartJS</title>
  6. <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
  7. <!-- Bootstrap 3.3.2 -->
  8. <link href="../../bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
  9. <!-- Font Awesome Icons -->
  10. <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
  11. <!-- Ionicons -->
  12. <link href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css" />
  13. <!-- Theme style -->
  14. <link href="../../dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
  15. <!-- AdminLTE Skins. Choose a skin from the css/skins
  16. folder instead of downloading all of them to reduce the load. -->
  17. <link href="../../dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
  18. <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  19. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  20. <!--[if lt IE 9]>
  21. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  22. <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
  23. <![endif]-->
  24. </head>
  25. <body class="skin-blue sidebar-mini">
  26. <div class="wrapper">
  27. <header class="main-header">
  28. <a href="../../index2.html" class="logo"><b>Admin</b>LTE</a>
  29. <!-- Header Navbar: style can be found in header.less -->
  30. <nav class="navbar navbar-static-top" role="navigation">
  31. <!-- Sidebar toggle button-->
  32. <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
  33. <span class="sr-only">Toggle navigation</span>
  34. <span class="icon-bar"></span>
  35. <span class="icon-bar"></span>
  36. <span class="icon-bar"></span>
  37. </a>
  38. <div class="navbar-custom-menu">
  39. <ul class="nav navbar-nav">
  40. <!-- Messages: style can be found in dropdown.less-->
  41. <li class="dropdown messages-menu">
  42. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  43. <i class="fa fa-envelope-o"></i>
  44. <span class="label label-success">4</span>
  45. </a>
  46. <ul class="dropdown-menu">
  47. <li class="header">You have 4 messages</li>
  48. <li>
  49. <!-- inner menu: contains the actual data -->
  50. <ul class="menu">
  51. <li><!-- start message -->
  52. <a href="#">
  53. <div class="pull-left">
  54. <img src="../../dist/img/user2-160x160.jpg" class="img-circle" alt="User Image"/>
  55. </div>
  56. <h4>
  57. Support Team
  58. <small><i class="fa fa-clock-o"></i> 5 mins</small>
  59. </h4>
  60. <p>Why not buy a new awesome theme?</p>
  61. </a>
  62. </li><!-- end message -->
  63. </ul>
  64. </li>
  65. <li class="footer"><a href="#">See All Messages</a></li>
  66. </ul>
  67. </li>
  68. <!-- Notifications: style can be found in dropdown.less -->
  69. <li class="dropdown notifications-menu">
  70. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  71. <i class="fa fa-bell-o"></i>
  72. <span class="label label-warning">10</span>
  73. </a>
  74. <ul class="dropdown-menu">
  75. <li class="header">You have 10 notifications</li>
  76. <li>
  77. <!-- inner menu: contains the actual data -->
  78. <ul class="menu">
  79. <li>
  80. <a href="#">
  81. <i class="fa fa-users text-aqua"></i> 5 new members joined today
  82. </a>
  83. </li>
  84. </ul>
  85. </li>
  86. <li class="footer"><a href="#">View all</a></li>
  87. </ul>
  88. </li>
  89. <!-- Tasks: style can be found in dropdown.less -->
  90. <li class="dropdown tasks-menu">
  91. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  92. <i class="fa fa-flag-o"></i>
  93. <span class="label label-danger">9</span>
  94. </a>
  95. <ul class="dropdown-menu">
  96. <li class="header">You have 9 tasks</li>
  97. <li>
  98. <!-- inner menu: contains the actual data -->
  99. <ul class="menu">
  100. <li><!-- Task item -->
  101. <a href="#">
  102. <h3>
  103. Design some buttons
  104. <small class="pull-right">20%</small>
  105. </h3>
  106. <div class="progress xs">
  107. <div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
  108. <span class="sr-only">20% Complete</span>
  109. </div>
  110. </div>
  111. </a>
  112. </li><!-- end task item -->
  113. </ul>
  114. </li>
  115. <li class="footer">
  116. <a href="#">View all tasks</a>
  117. </li>
  118. </ul>
  119. </li>
  120. <!-- User Account: style can be found in dropdown.less -->
  121. <li class="dropdown user user-menu">
  122. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  123. <img src="../../dist/img/user2-160x160.jpg" class="user-image" alt="User Image"/>
  124. <span class="hidden-xs">Alexander Pierce</span>
  125. </a>
  126. <ul class="dropdown-menu">
  127. <!-- User image -->
  128. <li class="user-header">
  129. <img src="../../dist/img/user2-160x160.jpg" class="img-circle" alt="User Image" />
  130. <p>
  131. Alexander Pierce - Web Developer
  132. <small>Member since Nov. 2012</small>
  133. </p>
  134. </li>
  135. <!-- Menu Body -->
  136. <li class="user-body">
  137. <div class="col-xs-4 text-center">
  138. <a href="#">Followers</a>
  139. </div>
  140. <div class="col-xs-4 text-center">
  141. <a href="#">Sales</a>
  142. </div>
  143. <div class="col-xs-4 text-center">
  144. <a href="#">Friends</a>
  145. </div>
  146. </li>
  147. <!-- Menu Footer-->
  148. <li class="user-footer">
  149. <div class="pull-left">
  150. <a href="#" class="btn btn-default btn-flat">Profile</a>
  151. </div>
  152. <div class="pull-right">
  153. <a href="#" class="btn btn-default btn-flat">Sign out</a>
  154. </div>
  155. </li>
  156. </ul>
  157. </li>
  158. </ul>
  159. </div>
  160. </nav>
  161. </header>
  162. <!-- Left side column. contains the logo and sidebar -->
  163. <aside class="main-sidebar">
  164. <!-- sidebar: style can be found in sidebar.less -->
  165. <section class="sidebar">
  166. <!-- Sidebar user panel -->
  167. <div class="user-panel">
  168. <div class="pull-left image">
  169. <img src="../../dist/img/user2-160x160.jpg" class="img-circle" alt="User Image" />
  170. </div>
  171. <div class="pull-left info">
  172. <p>Alexander Pierce</p>
  173. <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
  174. </div>
  175. </div>
  176. <!-- search form -->
  177. <form action="#" method="get" class="sidebar-form">
  178. <div class="input-group">
  179. <input type="text" name="q" class="form-control" placeholder="Search..."/>
  180. <span class="input-group-btn">
  181. <button type='submit' name='seach' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i></button>
  182. </span>
  183. </div>
  184. </form>
  185. <!-- /.search form -->
  186. <!-- sidebar menu: : style can be found in sidebar.less -->
  187. <ul class="sidebar-menu">
  188. <li class="header">MAIN NAVIGATION</li>
  189. <li class="treeview">
  190. <a href="#">
  191. <i class="fa fa-dashboard"></i> <span>Dashboard</span> <i class="fa fa-angle-left pull-right"></i>
  192. </a>
  193. <ul class="treeview-menu">
  194. <li><a href="../../index.html"><i class="fa fa-circle-o"></i> Dashboard v1</a></li>
  195. <li><a href="../../index2.html"><i class="fa fa-circle-o"></i> Dashboard v2</a></li>
  196. </ul>
  197. </li>
  198. <li class="treeview">
  199. <a href="#">
  200. <i class="fa fa-files-o"></i>
  201. <span>Layout Options</span>
  202. <span class="label label-primary pull-right">4</span>
  203. </a>
  204. <ul class="treeview-menu">
  205. <li><a href="../layout/top-nav.html"><i class="fa fa-circle-o"></i> Top Navigation</a></li>
  206. <li><a href="../layout/boxed.html"><i class="fa fa-circle-o"></i> Boxed</a></li>
  207. <li><a href="../layout/fixed.html"><i class="fa fa-circle-o"></i> Fixed</a></li>
  208. <li><a href="../layout/collapsed-sidebar.html"><i class="fa fa-circle-o"></i> Collapsed Sidebar</a></li>
  209. </ul>
  210. </li>
  211. <li>
  212. <a href="../widgets.html">
  213. <i class="fa fa-th"></i> <span>Widgets</span> <small class="label pull-right bg-green">new</small>
  214. </a>
  215. </li>
  216. <li class="treeview active">
  217. <a href="#">
  218. <i class="fa fa-pie-chart"></i>
  219. <span>Charts</span>
  220. <i class="fa fa-angle-left pull-right"></i>
  221. </a>
  222. <ul class="treeview-menu">
  223. <li class="active"><a href="morris.html"><i class="fa fa-circle-o"></i> Morris</a></li>
  224. <li><a href="flot.html"><i class="fa fa-circle-o"></i> Flot</a></li>
  225. <li><a href="inline.html"><i class="fa fa-circle-o"></i> Inline charts</a></li>
  226. </ul>
  227. </li>
  228. <li class="treeview">
  229. <a href="#">
  230. <i class="fa fa-laptop"></i>
  231. <span>UI Elements</span>
  232. <i class="fa fa-angle-left pull-right"></i>
  233. </a>
  234. <ul class="treeview-menu">
  235. <li><a href="../UI/general.html"><i class="fa fa-circle-o"></i> General</a></li>
  236. <li><a href="../UI/icons.html"><i class="fa fa-circle-o"></i> Icons</a></li>
  237. <li><a href="../UI/buttons.html"><i class="fa fa-circle-o"></i> Buttons</a></li>
  238. <li><a href="../UI/sliders.html"><i class="fa fa-circle-o"></i> Sliders</a></li>
  239. <li><a href="../UI/timeline.html"><i class="fa fa-circle-o"></i> Timeline</a></li>
  240. <li><a href="../UI/modals.html"><i class="fa fa-circle-o"></i> Modals</a></li>
  241. </ul>
  242. </li>
  243. <li class="treeview">
  244. <a href="#">
  245. <i class="fa fa-edit"></i> <span>Forms</span>
  246. <i class="fa fa-angle-left pull-right"></i>
  247. </a>
  248. <ul class="treeview-menu">
  249. <li><a href="../forms/general.html"><i class="fa fa-circle-o"></i> General Elements</a></li>
  250. <li><a href="../forms/advanced.html"><i class="fa fa-circle-o"></i> Advanced Elements</a></li>
  251. <li><a href="../forms/editors.html"><i class="fa fa-circle-o"></i> Editors</a></li>
  252. </ul>
  253. </li>
  254. <li class="treeview">
  255. <a href="#">
  256. <i class="fa fa-table"></i> <span>Tables</span>
  257. <i class="fa fa-angle-left pull-right"></i>
  258. </a>
  259. <ul class="treeview-menu">
  260. <li><a href="../tables/simple.html"><i class="fa fa-circle-o"></i> Simple tables</a></li>
  261. <li><a href="../tables/data.html"><i class="fa fa-circle-o"></i> Data tables</a></li>
  262. </ul>
  263. </li>
  264. <li>
  265. <a href="../calendar.html">
  266. <i class="fa fa-calendar"></i> <span>Calendar</span>
  267. <small class="label pull-right bg-red">3</small>
  268. </a>
  269. </li>
  270. <li>
  271. <a href="../mailbox/mailbox.html">
  272. <i class="fa fa-envelope"></i> <span>Mailbox</span>
  273. <small class="label pull-right bg-yellow">12</small>
  274. </a>
  275. </li>
  276. <li class="treeview">
  277. <a href="#">
  278. <i class="fa fa-folder"></i> <span>Examples</span>
  279. <i class="fa fa-angle-left pull-right"></i>
  280. </a>
  281. <ul class="treeview-menu">
  282. <li><a href="../examples/invoice.html"><i class="fa fa-circle-o"></i> Invoice</a></li>
  283. <li><a href="../examples/login.html"><i class="fa fa-circle-o"></i> Login</a></li>
  284. <li><a href="../examples/register.html"><i class="fa fa-circle-o"></i> Register</a></li>
  285. <li><a href="../examples/lockscreen.html"><i class="fa fa-circle-o"></i> Lockscreen</a></li>
  286. <li><a href="../examples/404.html"><i class="fa fa-circle-o"></i> 404 Error</a></li>
  287. <li><a href="../examples/500.html"><i class="fa fa-circle-o"></i> 500 Error</a></li>
  288. <li><a href="../examples/blank.html"><i class="fa fa-circle-o"></i> Blank Page</a></li>
  289. </ul>
  290. </li>
  291. <li class="treeview">
  292. <a href="#">
  293. <i class="fa fa-share"></i> <span>Multilevel</span>
  294. <i class="fa fa-angle-left pull-right"></i>
  295. </a>
  296. <ul class="treeview-menu">
  297. <li><a href="#"><i class="fa fa-circle-o"></i> Level One</a></li>
  298. <li>
  299. <a href="#"><i class="fa fa-circle-o"></i> Level One <i class="fa fa-angle-left pull-right"></i></a>
  300. <ul class="treeview-menu">
  301. <li><a href="#"><i class="fa fa-circle-o"></i> Level Two</a></li>
  302. <li>
  303. <a href="#"><i class="fa fa-circle-o"></i> Level Two <i class="fa fa-angle-left pull-right"></i></a>
  304. <ul class="treeview-menu">
  305. <li><a href="#"><i class="fa fa-circle-o"></i> Level Three</a></li>
  306. <li><a href="#"><i class="fa fa-circle-o"></i> Level Three</a></li>
  307. </ul>
  308. </li>
  309. </ul>
  310. </li>
  311. <li><a href="#"><i class="fa fa-circle-o"></i> Level One</a></li>
  312. </ul>
  313. </li>
  314. <li><a href="../../documentation/index.html"><i class="fa fa-book"></i> <span>Documentation</span></a></li>
  315. <li class="header">LABELS</li>
  316. <li><a href="#"><i class="fa fa-circle-o text-danger"></i> <span>Important</span></a></li>
  317. <li><a href="#"><i class="fa fa-circle-o text-warning"></i> <span>Warning</span></a></li>
  318. <li><a href="#"><i class="fa fa-circle-o text-info"></i> <span>Information</span></a></li>
  319. </ul>
  320. </section>
  321. <!-- /.sidebar -->
  322. </aside>
  323. <!-- Content Wrapper. Contains page content -->
  324. <div class="content-wrapper">
  325. <!-- Content Header (Page header) -->
  326. <section class="content-header">
  327. <h1>
  328. ChartJS
  329. <small>Preview sample</small>
  330. </h1>
  331. <ol class="breadcrumb">
  332. <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
  333. <li><a href="#">Charts</a></li>
  334. <li class="active">Morris</li>
  335. </ol>
  336. </section>
  337. <!-- Main content -->
  338. <section class="content">
  339. <div class="row">
  340. <div class="col-md-6">
  341. <!-- AREA CHART -->
  342. <div class="box box-primary">
  343. <div class="box-header with-border">
  344. <h3 class="box-title">Area Chart</h3>
  345. <div class="box-tools pull-right">
  346. <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
  347. <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
  348. </div>
  349. </div>
  350. <div class="box-body">
  351. <div class="margin">
  352. <canvas id="areaChart" height="250"></canvas>
  353. </div>
  354. </div><!-- /.box-body -->
  355. </div><!-- /.box -->
  356. <!-- DONUT CHART -->
  357. <div class="box box-danger">
  358. <div class="box-header with-border">
  359. <h3 class="box-title">Donut Chart</h3>
  360. <div class="box-tools pull-right">
  361. <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
  362. <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
  363. </div>
  364. </div>
  365. <div class="box-body">
  366. <div class="chart-responsive">
  367. <canvas id="pieChart" height="250"></canvas>
  368. </div>
  369. </div><!-- /.box-body -->
  370. </div><!-- /.box -->
  371. </div><!-- /.col (LEFT) -->
  372. <div class="col-md-6">
  373. <!-- LINE CHART -->
  374. <div class="box box-info">
  375. <div class="box-header with-border">
  376. <h3 class="box-title">Line Chart</h3>
  377. <div class="box-tools pull-right">
  378. <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
  379. <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
  380. </div>
  381. </div>
  382. <div class="box-body">
  383. <div class="margin">
  384. <canvas id="lineChart" height="250"></canvas>
  385. </div>
  386. </div><!-- /.box-body -->
  387. </div><!-- /.box -->
  388. <!-- BAR CHART -->
  389. <div class="box box-success">
  390. <div class="box-header with-border">
  391. <h3 class="box-title">Bar Chart</h3>
  392. <div class="box-tools pull-right">
  393. <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
  394. <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
  395. </div>
  396. </div>
  397. <div class="box-body">
  398. <div class="margin">
  399. <canvas id="barChart" height="230"></canvas>
  400. </div>
  401. </div><!-- /.box-body -->
  402. </div><!-- /.box -->
  403. </div><!-- /.col (RIGHT) -->
  404. </div><!-- /.row -->
  405. </section><!-- /.content -->
  406. </div><!-- /.content-wrapper -->
  407. <footer class="main-footer">
  408. <div class="pull-right hidden-xs">
  409. <b>Version</b> 2.0
  410. </div>
  411. <strong>Copyright &copy; 2014-2015 <a href="http://almsaeedstudio.com">Almsaeed Studio</a>.</strong> All rights reserved.
  412. </footer>
  413. </div><!-- ./wrapper -->
  414. <!-- jQuery 2.1.3 -->
  415. <script src="../../plugins/jQuery/jQuery-2.1.3.min.js"></script>
  416. <!-- Bootstrap 3.3.2 JS -->
  417. <script src="../../bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
  418. <!-- ChartJS 1.0.1 -->
  419. <script src="../../plugins/chartjs/Chart.min.js" type="text/javascript"></script>
  420. <!-- FastClick -->
  421. <script src='../../plugins/fastclick/fastclick.min.js'></script>
  422. <!-- AdminLTE App -->
  423. <script src="../../dist/js/app.min.js" type="text/javascript"></script>
  424. <!-- AdminLTE for demo purposes -->
  425. <script src="../../dist/js/demo.js" type="text/javascript"></script>
  426. <!-- page script -->
  427. <script>
  428. $(function () {
  429. /* ChartJS
  430. * -------
  431. * Here we will create a few charts using ChartJS
  432. */
  433. //--------------
  434. //- AREA CHART -
  435. //--------------
  436. // Get context with jQuery - using jQuery's .get() method.
  437. var areaChartCanvas = $("#areaChart").get(0).getContext("2d");
  438. // This will get the first returned node in the jQuery collection.
  439. var areaChart = new Chart(areaChartCanvas);
  440. var areaChartData = {
  441. labels: ["January", "February", "March", "April", "May", "June", "July"],
  442. datasets: [
  443. {
  444. label: "Electronics",
  445. fillColor: "rgba(210, 214, 222, 1)",
  446. strokeColor: "rgba(210, 214, 222, 1)",
  447. pointColor: "rgba(210, 214, 222, 1)",
  448. pointStrokeColor: "#c1c7d1",
  449. pointHighlightFill: "#fff",
  450. pointHighlightStroke: "rgba(220,220,220,1)",
  451. data: [65, 59, 80, 81, 56, 55, 40]
  452. },
  453. {
  454. label: "Digital Goods",
  455. fillColor: "rgba(60,141,188,0.9)",
  456. strokeColor: "rgba(60,141,188,0.8)",
  457. pointColor: "#3b8bba",
  458. pointStrokeColor: "rgba(60,141,188,1)",
  459. pointHighlightFill: "#fff",
  460. pointHighlightStroke: "rgba(60,141,188,1)",
  461. data: [28, 48, 40, 19, 86, 27, 90]
  462. }
  463. ]
  464. };
  465. var areaChartOptions = {
  466. //Boolean - If we should show the scale at all
  467. showScale: true,
  468. //Boolean - Whether grid lines are shown across the chart
  469. scaleShowGridLines: false,
  470. //String - Colour of the grid lines
  471. scaleGridLineColor: "rgba(0,0,0,.05)",
  472. //Number - Width of the grid lines
  473. scaleGridLineWidth: 1,
  474. //Boolean - Whether to show horizontal lines (except X axis)
  475. scaleShowHorizontalLines: true,
  476. //Boolean - Whether to show vertical lines (except Y axis)
  477. scaleShowVerticalLines: true,
  478. //Boolean - Whether the line is curved between points
  479. bezierCurve: true,
  480. //Number - Tension of the bezier curve between points
  481. bezierCurveTension: 0.3,
  482. //Boolean - Whether to show a dot for each point
  483. pointDot: false,
  484. //Number - Radius of each point dot in pixels
  485. pointDotRadius: 4,
  486. //Number - Pixel width of point dot stroke
  487. pointDotStrokeWidth: 1,
  488. //Number - amount extra to add to the radius to cater for hit detection outside the drawn point
  489. pointHitDetectionRadius: 20,
  490. //Boolean - Whether to show a stroke for datasets
  491. datasetStroke: true,
  492. //Number - Pixel width of dataset stroke
  493. datasetStrokeWidth: 2,
  494. //Boolean - Whether to fill the dataset with a color
  495. datasetFill: true,
  496. //String - A legend template
  497. legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].lineColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
  498. //Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
  499. maintainAspectRatio: false,
  500. //Boolean - whether to make the chart responsive to window resizing
  501. responsive: true
  502. };
  503. //Create the line chart
  504. areaChart.Line(areaChartData, areaChartOptions);
  505. //-------------
  506. //- LINE CHART -
  507. //--------------
  508. var lineChartCanvas = $("#lineChart").get(0).getContext("2d");
  509. var lineChart = new Chart(lineChartCanvas);
  510. var lineChartOptions = areaChartOptions;
  511. lineChartOptions.datasetFill = false;
  512. lineChart.Line(areaChartData, lineChartOptions);
  513. //-------------
  514. //- PIE CHART -
  515. //-------------
  516. // Get context with jQuery - using jQuery's .get() method.
  517. var pieChartCanvas = $("#pieChart").get(0).getContext("2d");
  518. var pieChart = new Chart(pieChartCanvas);
  519. var PieData = [
  520. {
  521. value: 700,
  522. color: "#f56954",
  523. highlight: "#f56954",
  524. label: "Chrome"
  525. },
  526. {
  527. value: 500,
  528. color: "#00a65a",
  529. highlight: "#00a65a",
  530. label: "IE"
  531. },
  532. {
  533. value: 400,
  534. color: "#f39c12",
  535. highlight: "#f39c12",
  536. label: "FireFox"
  537. },
  538. {
  539. value: 600,
  540. color: "#00c0ef",
  541. highlight: "#00c0ef",
  542. label: "Safari"
  543. },
  544. {
  545. value: 300,
  546. color: "#3c8dbc",
  547. highlight: "#3c8dbc",
  548. label: "Opera"
  549. },
  550. {
  551. value: 100,
  552. color: "#d2d6de",
  553. highlight: "#d2d6de",
  554. label: "Navigator"
  555. }
  556. ];
  557. var pieOptions = {
  558. //Boolean - Whether we should show a stroke on each segment
  559. segmentShowStroke: true,
  560. //String - The colour of each segment stroke
  561. segmentStrokeColor: "#fff",
  562. //Number - The width of each segment stroke
  563. segmentStrokeWidth: 2,
  564. //Number - The percentage of the chart that we cut out of the middle
  565. percentageInnerCutout: 50, // This is 0 for Pie charts
  566. //Number - Amount of animation steps
  567. animationSteps: 100,
  568. //String - Animation easing effect
  569. animationEasing: "easeOutBounce",
  570. //Boolean - Whether we animate the rotation of the Doughnut
  571. animateRotate: true,
  572. //Boolean - Whether we animate scaling the Doughnut from the centre
  573. animateScale: false,
  574. //Boolean - whether to make the chart responsive to window resizing
  575. responsive: true,
  576. // Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
  577. maintainAspectRatio: false,
  578. //String - A legend template
  579. legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"
  580. };
  581. //Create pie or douhnut chart
  582. // You can switch between pie and douhnut using the method below.
  583. pieChart.Doughnut(PieData, pieOptions);
  584. //-------------
  585. //- BAR CHART -
  586. //-------------
  587. var barChartCanvas = $("#barChart").get(0).getContext("2d");
  588. var barChart = new Chart(barChartCanvas);
  589. var barChartData = areaChartData;
  590. barChartData.datasets[1].fillColor = "#00a65a";
  591. barChartData.datasets[1].strokeColor = "#00a65a";
  592. barChartData.datasets[1].pointColor = "#00a65a";
  593. var barChartOptions = {
  594. //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
  595. scaleBeginAtZero: true,
  596. //Boolean - Whether grid lines are shown across the chart
  597. scaleShowGridLines: true,
  598. //String - Colour of the grid lines
  599. scaleGridLineColor: "rgba(0,0,0,.05)",
  600. //Number - Width of the grid lines
  601. scaleGridLineWidth: 1,
  602. //Boolean - Whether to show horizontal lines (except X axis)
  603. scaleShowHorizontalLines: true,
  604. //Boolean - Whether to show vertical lines (except Y axis)
  605. scaleShowVerticalLines: true,
  606. //Boolean - If there is a stroke on each bar
  607. barShowStroke: true,
  608. //Number - Pixel width of the bar stroke
  609. barStrokeWidth: 2,
  610. //Number - Spacing between each of the X value sets
  611. barValueSpacing: 5,
  612. //Number - Spacing between data sets within X values
  613. barDatasetSpacing: 1,
  614. //String - A legend template
  615. legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
  616. //Boolean - whether to make the chart responsive
  617. responsive: true,
  618. maintainAspectRatio: false
  619. };
  620. barChartOptions.datasetFill = false;
  621. barChart.Bar(barChartData, barChartOptions);
  622. });
  623. </script>
  624. </body>
  625. </html>