chartjs.html 27 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 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> Documentation</a></li>
  315. <li class="header">LABELS</li>
  316. <li><a href="#"><i class="fa fa-circle-o text-danger"></i> Important</a></li>
  317. <li><a href="#"><i class="fa fa-circle-o text-warning"></i> Warning</a></li>
  318. <li><a href="#"><i class="fa fa-circle-o text-info"></i> Information</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">
  344. <h3 class="box-title">Area Chart</h3>
  345. </div>
  346. <div class="box-body">
  347. <canvas id="areaChart" height="250"></canvas>
  348. </div><!-- /.box-body -->
  349. </div><!-- /.box -->
  350. <!-- DONUT CHART -->
  351. <div class="box box-danger">
  352. <div class="box-header">
  353. <h3 class="box-title">Donut Chart</h3>
  354. </div>
  355. <div class="box-body">
  356. <div class="chart-responsive">
  357. <canvas id="pieChart" height="250"></canvas>
  358. </div>
  359. </div><!-- /.box-body -->
  360. </div><!-- /.box -->
  361. </div><!-- /.col (LEFT) -->
  362. <div class="col-md-6">
  363. <!-- LINE CHART -->
  364. <div class="box box-info">
  365. <div class="box-header">
  366. <h3 class="box-title">Line Chart</h3>
  367. </div>
  368. <div class="box-body">
  369. <canvas id="lineChart" height="250"></canvas>
  370. </div><!-- /.box-body -->
  371. </div><!-- /.box -->
  372. <!-- BAR CHART -->
  373. <div class="box box-success">
  374. <div class="box-header">
  375. <h3 class="box-title">Bar Chart</h3>
  376. </div>
  377. <div class="box-body">
  378. <canvas id="barChart" height="230"></canvas>
  379. </div><!-- /.box-body -->
  380. </div><!-- /.box -->
  381. </div><!-- /.col (RIGHT) -->
  382. </div><!-- /.row -->
  383. </section><!-- /.content -->
  384. </div><!-- /.content-wrapper -->
  385. <footer class="main-footer">
  386. <div class="pull-right hidden-xs">
  387. <b>Version</b> 2.0
  388. </div>
  389. <strong>Copyright &copy; 2014-2015 <a href="http://almsaeedstudio.com">Almsaeed Studio</a>.</strong> All rights reserved.
  390. </footer>
  391. </div><!-- ./wrapper -->
  392. <!-- jQuery 2.1.3 -->
  393. <script src="../../plugins/jQuery/jQuery-2.1.3.min.js"></script>
  394. <!-- Bootstrap 3.3.2 JS -->
  395. <script src="../../bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
  396. <!-- ChartJS 1.0.1 -->
  397. <script src="../../plugins/chartjs/Chart.min.js" type="text/javascript"></script>
  398. <!-- FastClick -->
  399. <script src='../../plugins/fastclick/fastclick.min.js'></script>
  400. <!-- AdminLTE App -->
  401. <script src="../../dist/js/app.min.js" type="text/javascript"></script>
  402. <!-- AdminLTE for demo purposes -->
  403. <script src="../../dist/js/demo.js" type="text/javascript"></script>
  404. <!-- page script -->
  405. <script>
  406. $(function () {
  407. /* ChartJS
  408. * -------
  409. * Here we will create a few charts using ChartJS
  410. */
  411. //--------------
  412. //- AREA CHART -
  413. //--------------
  414. // Get context with jQuery - using jQuery's .get() method.
  415. var areaChartCanvas = $("#areaChart").get(0).getContext("2d");
  416. // This will get the first returned node in the jQuery collection.
  417. var areaChart = new Chart(areaChartCanvas);
  418. var areaChartData = {
  419. labels: ["January", "February", "March", "April", "May", "June", "July"],
  420. datasets: [
  421. {
  422. label: "Electronics",
  423. fillColor: "rgba(210, 214, 222, 1)",
  424. strokeColor: "rgba(210, 214, 222, 1)",
  425. pointColor: "rgba(210, 214, 222, 1)",
  426. pointStrokeColor: "#c1c7d1",
  427. pointHighlightFill: "#fff",
  428. pointHighlightStroke: "rgba(220,220,220,1)",
  429. data: [65, 59, 80, 81, 56, 55, 40]
  430. },
  431. {
  432. label: "Digital Goods",
  433. fillColor: "rgba(60,141,188,0.9)",
  434. strokeColor: "rgba(60,141,188,0.8)",
  435. pointColor: "#3b8bba",
  436. pointStrokeColor: "rgba(60,141,188,1)",
  437. pointHighlightFill: "#fff",
  438. pointHighlightStroke: "rgba(60,141,188,1)",
  439. data: [28, 48, 40, 19, 86, 27, 90]
  440. }
  441. ]
  442. };
  443. var areaChartOptions = {
  444. //Boolean - If we should show the scale at all
  445. showScale: true,
  446. //Boolean - Whether grid lines are shown across the chart
  447. scaleShowGridLines: false,
  448. //String - Colour of the grid lines
  449. scaleGridLineColor: "rgba(0,0,0,.05)",
  450. //Number - Width of the grid lines
  451. scaleGridLineWidth: 1,
  452. //Boolean - Whether to show horizontal lines (except X axis)
  453. scaleShowHorizontalLines: true,
  454. //Boolean - Whether to show vertical lines (except Y axis)
  455. scaleShowVerticalLines: true,
  456. //Boolean - Whether the line is curved between points
  457. bezierCurve: true,
  458. //Number - Tension of the bezier curve between points
  459. bezierCurveTension: 0.3,
  460. //Boolean - Whether to show a dot for each point
  461. pointDot: false,
  462. //Number - Radius of each point dot in pixels
  463. pointDotRadius: 4,
  464. //Number - Pixel width of point dot stroke
  465. pointDotStrokeWidth: 1,
  466. //Number - amount extra to add to the radius to cater for hit detection outside the drawn point
  467. pointHitDetectionRadius: 20,
  468. //Boolean - Whether to show a stroke for datasets
  469. datasetStroke: true,
  470. //Number - Pixel width of dataset stroke
  471. datasetStrokeWidth: 2,
  472. //Boolean - Whether to fill the dataset with a color
  473. datasetFill: true,
  474. //String - A legend template
  475. 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>",
  476. //Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
  477. maintainAspectRatio: false,
  478. //Boolean - whether to make the chart responsive to window resizing
  479. responsive: true
  480. };
  481. //Create the line chart
  482. areaChart.Line(areaChartData, areaChartOptions);
  483. //-------------
  484. //- LINE CHART -
  485. //--------------
  486. var lineChartCanvas = $("#lineChart").get(0).getContext("2d");
  487. var lineChart = new Chart(lineChartCanvas);
  488. var lineChartOptions = areaChartOptions;
  489. lineChartOptions.datasetFill = false;
  490. lineChart.Line(areaChartData, lineChartOptions);
  491. //-------------
  492. //- PIE CHART -
  493. //-------------
  494. // Get context with jQuery - using jQuery's .get() method.
  495. var pieChartCanvas = $("#pieChart").get(0).getContext("2d");
  496. var pieChart = new Chart(pieChartCanvas);
  497. var PieData = [
  498. {
  499. value: 700,
  500. color: "#f56954",
  501. highlight: "#f56954",
  502. label: "Chrome"
  503. },
  504. {
  505. value: 500,
  506. color: "#00a65a",
  507. highlight: "#00a65a",
  508. label: "IE"
  509. },
  510. {
  511. value: 400,
  512. color: "#f39c12",
  513. highlight: "#f39c12",
  514. label: "FireFox"
  515. },
  516. {
  517. value: 600,
  518. color: "#00c0ef",
  519. highlight: "#00c0ef",
  520. label: "Safari"
  521. },
  522. {
  523. value: 300,
  524. color: "#3c8dbc",
  525. highlight: "#3c8dbc",
  526. label: "Opera"
  527. },
  528. {
  529. value: 100,
  530. color: "#d2d6de",
  531. highlight: "#d2d6de",
  532. label: "Navigator"
  533. }
  534. ];
  535. var pieOptions = {
  536. //Boolean - Whether we should show a stroke on each segment
  537. segmentShowStroke: true,
  538. //String - The colour of each segment stroke
  539. segmentStrokeColor: "#fff",
  540. //Number - The width of each segment stroke
  541. segmentStrokeWidth: 2,
  542. //Number - The percentage of the chart that we cut out of the middle
  543. percentageInnerCutout: 50, // This is 0 for Pie charts
  544. //Number - Amount of animation steps
  545. animationSteps: 100,
  546. //String - Animation easing effect
  547. animationEasing: "easeOutBounce",
  548. //Boolean - Whether we animate the rotation of the Doughnut
  549. animateRotate: true,
  550. //Boolean - Whether we animate scaling the Doughnut from the centre
  551. animateScale: false,
  552. //Boolean - whether to make the chart responsive to window resizing
  553. responsive: true,
  554. // Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
  555. maintainAspectRatio: false,
  556. //String - A legend template
  557. 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>"
  558. };
  559. //Create pie or douhnut chart
  560. // You can switch between pie and douhnut using the method below.
  561. pieChart.Doughnut(PieData, pieOptions);
  562. //-------------
  563. //- BAR CHART -
  564. //-------------
  565. var barChartCanvas = $("#barChart").get(0).getContext("2d");
  566. var barChart = new Chart(barChartCanvas);
  567. var barChartData = areaChartData;
  568. barChartData.datasets[1].fillColor = "#00a65a";
  569. barChartData.datasets[1].strokeColor = "#00a65a";
  570. barChartData.datasets[1].pointColor = "#00a65a";
  571. var barChartOptions = {
  572. //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
  573. scaleBeginAtZero: true,
  574. //Boolean - Whether grid lines are shown across the chart
  575. scaleShowGridLines: true,
  576. //String - Colour of the grid lines
  577. scaleGridLineColor: "rgba(0,0,0,.05)",
  578. //Number - Width of the grid lines
  579. scaleGridLineWidth: 1,
  580. //Boolean - Whether to show horizontal lines (except X axis)
  581. scaleShowHorizontalLines: true,
  582. //Boolean - Whether to show vertical lines (except Y axis)
  583. scaleShowVerticalLines: true,
  584. //Boolean - If there is a stroke on each bar
  585. barShowStroke: true,
  586. //Number - Pixel width of the bar stroke
  587. barStrokeWidth: 2,
  588. //Number - Spacing between each of the X value sets
  589. barValueSpacing: 5,
  590. //Number - Spacing between data sets within X values
  591. barDatasetSpacing: 1,
  592. //String - A legend template
  593. 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>",
  594. //Boolean - whether to make the chart responsive
  595. responsive: true,
  596. maintainAspectRatio: false
  597. };
  598. barChartOptions.datasetFill = false;
  599. barChart.Bar(barChartData, barChartOptions);
  600. });
  601. </script>
  602. </body>
  603. </html>