chartjs.html 28 KB

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