chartjs.html 29 KB

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