AdminLTE/pages/charts/chartjs.html

824 lines
31 KiB
HTML
Raw Normal View History

2015-02-11 01:53:16 +01:00
<!DOCTYPE html>
<html>
2015-09-19 20:05:54 +02:00
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
2016-10-22 21:32:28 +02:00
<title>AdminLTE 3 | ChartJS</title>
2015-09-19 20:05:54 +02:00
<!-- Tell the browser to be responsive to screen width -->
2018-03-17 18:07:55 +01:00
<meta name="viewport" content="width=device-width, initial-scale=1">
2015-09-19 20:05:54 +02:00
<!-- Font Awesome -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<!-- Theme style -->
2018-03-17 18:07:55 +01:00
<link rel="stylesheet" href="../../dist/css/adminlte.min.css">
<!-- Google Font: Source Sans Pro -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
2015-09-19 20:05:54 +02:00
</head>
2018-03-17 18:07:55 +01:00
<body class="hold-transition sidebar-mini">
2015-09-19 20:05:54 +02:00
<div class="wrapper">
2018-03-17 18:07:55 +01:00
<!-- Navbar -->
<nav class="main-header navbar navbar-expand bg-white navbar-light border-bottom">
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#"><i class="fa fa-bars"></i></a>
</li>
<li class="nav-item d-none d-sm-inline-block">
<a href="../../index3.html" class="nav-link">Home</a>
</li>
<li class="nav-item d-none d-sm-inline-block">
<a href="#" class="nav-link">Contact</a>
</li>
</ul>
2015-09-19 20:05:54 +02:00
2018-03-17 18:07:55 +01:00
<!-- SEARCH FORM -->
<form class="form-inline ml-3">
<div class="input-group input-group-sm">
<input class="form-control form-control-navbar" type="search" placeholder="Search" aria-label="Search">
<div class="input-group-append">
<button class="btn btn-navbar" type="submit">
<i class="fa fa-search"></i>
</button>
</div>
</div>
</form>
<!-- Right navbar links -->
<ul class="navbar-nav ml-auto">
<!-- Messages Dropdown Menu -->
<li class="nav-item dropdown">
<a class="nav-link" data-toggle="dropdown" href="#">
<i class="fa fa-comments-o"></i>
<span class="badge badge-danger navbar-badge">3</span>
</a>
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
<a href="#" class="dropdown-item">
<!-- Message Start -->
<div class="media">
<img src="../../dist/img/user1-128x128.jpg" alt="User Avatar" class="img-size-50 mr-3 img-circle">
<div class="media-body">
<h3 class="dropdown-item-title">
Brad Diesel
<span class="float-right text-sm text-danger"><i class="fa fa-star"></i></span>
</h3>
<p class="text-sm">Call me whenever you can...</p>
<p class="text-sm text-muted"><i class="fa fa-clock-o mr-1"></i> 4 Hours Ago</p>
</div>
</div>
<!-- Message End -->
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">
<!-- Message Start -->
<div class="media">
<img src="../../dist/img/user8-128x128.jpg" alt="User Avatar" class="img-size-50 img-circle mr-3">
<div class="media-body">
<h3 class="dropdown-item-title">
John Pierce
<span class="float-right text-sm text-muted"><i class="fa fa-star"></i></span>
</h3>
<p class="text-sm">I got your message bro</p>
<p class="text-sm text-muted"><i class="fa fa-clock-o mr-1"></i> 4 Hours Ago</p>
</div>
</div>
<!-- Message End -->
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">
<!-- Message Start -->
<div class="media">
<img src="../../dist/img/user3-128x128.jpg" alt="User Avatar" class="img-size-50 img-circle mr-3">
<div class="media-body">
<h3 class="dropdown-item-title">
Nora Silvester
<span class="float-right text-sm text-warning"><i class="fa fa-star"></i></span>
</h3>
<p class="text-sm">The subject goes here</p>
<p class="text-sm text-muted"><i class="fa fa-clock-o mr-1"></i> 4 Hours Ago</p>
</div>
</div>
<!-- Message End -->
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item dropdown-footer">See All Messages</a>
</div>
</li>
<!-- Notifications Dropdown Menu -->
<li class="nav-item dropdown">
<a class="nav-link" data-toggle="dropdown" href="#">
<i class="fa fa-bell-o"></i>
<span class="badge badge-warning navbar-badge">15</span>
</a>
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
<span class="dropdown-item dropdown-header">15 Notifications</span>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">
<i class="fa fa-envelope icon-wide"></i> 4 new messages
<span class="float-right text-muted text-sm">3 mins</span>
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">
<i class="fa fa-users icon-wide"></i> 8 friend requests
<span class="float-right text-muted text-sm">12 hours</span>
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">
<i class="fa fa-file icon-wide"></i> 3 new reports
<span class="float-right text-muted text-sm">2 days</span>
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item dropdown-footer">See All Notifications</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#">
<i class="fa fa-th-large"></i>
</a>
</li>
</ul>
</nav>
<!-- /.navbar -->
<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<!-- Brand Logo -->
<a href="../../index3.html" class="brand-link">
<img src="../../dist/img/AdminLTELogo.png"
alt="AdminLTE Logo"
class="brand-image img-circle elevation-3"
style="opacity: .8">
<span class="brand-text font-weight-light">AdminLTE 3</span>
2015-09-19 20:05:54 +02:00
</a>
2018-03-17 18:07:55 +01:00
<!-- Sidebar -->
<div class="sidebar font-weight-light">
<!-- Sidebar user panel (optional) -->
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
<div class="image">
<img src="../../dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image">
</div>
<div class="info">
<a href="#" class="d-block">Alexander Pierce</a>
</div>
</div>
<!-- Sidebar Menu -->
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
<!-- Add icons to the links using the .nav-icon class
with font-awesome or any other icon font library -->
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fa fa-dashboard"></i>
<p>
Dashboard
<i class="right fa fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../../index.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Dashboard v1</p>
</a>
</li>
<li class="nav-item">
<a href="../../index2.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Dashboard v2</p>
</a>
</li>
<li class="nav-item">
<a href="../../index3.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Dashboard v3</p>
</a>
</li>
</ul>
</li>
<li class="nav-item">
<a href="../widgets.html" class="nav-link">
<i class="nav-icon fa fa-th"></i>
<p>
Widgets
<span class="right badge badge-danger">New</span>
</p>
</a>
</li>
<li class="nav-item has-treeview menu-open">
<a href="#" class="nav-link active">
<i class="nav-icon fa fa-pie-chart"></i>
<p>
Charts
<i class="right fa fa-angle-left"></i>
</p>
2015-09-19 20:05:54 +02:00
</a>
2018-03-17 18:07:55 +01:00
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="chartjs.html" class="nav-link active">
<i class="fa fa-circle-o nav-icon"></i>
<p>ChartJS</p>
</a>
</li>
<li class="nav-item">
<a href="flot.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Flot</p>
</a>
</li>
<li class="nav-item">
<a href="inline.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Inline</p>
</a>
2015-02-11 01:53:16 +01:00
</li>
2015-09-19 20:05:54 +02:00
</ul>
</li>
2018-03-17 18:07:55 +01:00
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fa fa-tree"></i>
<p>
UI Elements
<i class="fa fa-angle-left right"></i>
</p>
2015-09-19 20:05:54 +02:00
</a>
2018-03-17 18:07:55 +01:00
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../UI/general.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>General</p>
</a>
</li>
<li class="nav-item">
<a href="../UI/icons.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Icons</p>
</a>
</li>
<li class="nav-item">
<a href="../UI/buttons.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Buttons</p>
</a>
</li>
<li class="nav-item">
<a href="../UI/sliders.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Sliders</p>
</a>
2015-02-11 01:53:16 +01:00
</li>
2015-09-19 20:05:54 +02:00
</ul>
</li>
2018-03-17 18:07:55 +01:00
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fa fa-edit"></i>
<p>
Forms
<i class="fa fa-angle-left right"></i>
</p>
2015-09-19 20:05:54 +02:00
</a>
2018-03-17 18:07:55 +01:00
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../forms/general.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>General Elements</p>
</a>
</li>
<li class="nav-item">
<a href="../forms/advanced.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Advanced Elements</p>
</a>
2015-02-11 01:53:16 +01:00
</li>
2018-03-17 18:07:55 +01:00
<li class="nav-item">
<a href="../forms/editors.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Editors</p>
</a>
2015-04-04 03:19:55 +02:00
</li>
2015-02-11 01:53:16 +01:00
</ul>
2015-09-19 20:05:54 +02:00
</li>
2018-03-17 18:07:55 +01:00
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fa fa-table"></i>
<p>
Tables
<i class="fa fa-angle-left right"></i>
</p>
2015-09-19 20:05:54 +02:00
</a>
2018-03-17 18:07:55 +01:00
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../tables/simple.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Simple Tables</p>
</a>
2015-09-19 20:05:54 +02:00
</li>
2018-03-17 18:07:55 +01:00
<li class="nav-item">
<a href="../tables/data.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Data Tables</p>
</a>
2015-09-19 20:05:54 +02:00
</li>
2018-03-17 18:07:55 +01:00
</ul>
</li>
<li class="nav-header">EXAMPLES</li>
<li class="nav-item">
<a href="../calendar.html" class="nav-link">
<i class="nav-icon fa fa-calendar"></i>
<p>
Calendar
<span class="badge badge-info right">2</span>
</p>
</a>
</li>
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fa fa-envelope-o"></i>
<p>
Mailbox
<i class="fa fa-angle-left right"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../mailbox/mailbox.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Inbox</p>
</a>
</li>
<li class="nav-item">
<a href="../mailbox/compose.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Compose</p>
</a>
</li>
<li class="nav-item">
<a href="../mailbox/read-mail.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Read</p>
</a>
2015-09-19 20:05:54 +02:00
</li>
</ul>
</li>
2018-03-17 18:07:55 +01:00
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fa fa-book"></i>
<p>
Pages
<i class="fa fa-angle-left right"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../examples/invoice.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Invoice</p>
</a>
</li>
<li class="nav-item">
<a href="../examples/profile.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Profile</p>
</a>
</li>
<li class="nav-item">
<a href="../examples/login.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Login</p>
</a>
</li>
<li class="nav-item">
<a href="../examples/register.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Register</p>
</a>
</li>
<li class="nav-item">
<a href="../examples/lockscreen.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Lockscreen</p>
</a>
</li>
</ul>
</li>
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fa fa-plus-square-o"></i>
<p>
Extras
<i class="fa fa-angle-left right"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../examples/404.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Error 404</p>
</a>
</li>
<li class="nav-item">
<a href="../examples/500.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Error 500</p>
</a>
</li>
<li class="nav-item">
<a href="../examples/blank.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Blank Page</p>
</a>
</li>
<li class="nav-item">
<a href="../../starter.html" class="nav-link">
<i class="fa fa-circle-o nav-icon"></i>
<p>Starter Page</p>
</a>
</li>
</ul>
</li>
<li class="nav-header">MISCELLANEOUS</li>
<li class="nav-item">
<a href="https://adminlte.io/docs" class="nav-link">
<i class="nav-icon fa fa-file"></i>
<p>Documentation</p>
</a>
</li>
<li class="nav-header">LABELS</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fa fa-circle-o text-danger"></i>
<p class="text">Important</p>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fa fa-circle-o text-warning"></i>
<p>Warning</p>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fa fa-circle-o text-info"></i>
<p>Informational</p>
</a>
2015-09-19 20:05:54 +02:00
</li>
</ul>
2018-03-17 18:07:55 +01:00
</nav>
<!-- /.sidebar-menu -->
</div>
2015-09-19 20:05:54 +02:00
<!-- /.sidebar -->
</aside>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
2018-03-17 18:07:55 +01:00
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>ChartJS</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">ChartJS</li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
2015-09-19 20:05:54 +02:00
</section>
<!-- Main content -->
<section class="content">
2018-03-17 18:07:55 +01:00
<div class="container-fluid">
<div class="row">
<div class="col-md-6">
<!-- AREA CHART -->
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Area Chart</h3>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
2015-09-19 20:05:54 +02:00
</div>
2018-03-17 18:07:55 +01:00
<div class="card-body">
<div class="chart">
<canvas id="areaChart" style="height:250px"></canvas>
</div>
2015-09-19 20:05:54 +02:00
</div>
2018-03-17 18:07:55 +01:00
<!-- /.card-body -->
2015-09-19 20:05:54 +02:00
</div>
2018-03-17 18:07:55 +01:00
<!-- /.card -->
2015-02-11 01:53:16 +01:00
2018-03-17 18:07:55 +01:00
<!-- DONUT CHART -->
<div class="card card-danger">
<div class="card-header">
<h3 class="card-title">Donut Chart</h3>
2015-09-19 20:05:54 +02:00
2018-03-17 18:07:55 +01:00
<div class="card-tools">
<button type="button" class="btn btn-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
2015-09-19 20:05:54 +02:00
</div>
2018-03-17 18:07:55 +01:00
<div class="card-body">
<canvas id="pieChart" style="height:250px"></canvas>
</div>
<!-- /.card-body -->
2015-09-19 20:05:54 +02:00
</div>
2018-03-17 18:07:55 +01:00
<!-- /.card -->
2015-02-11 01:53:16 +01:00
2018-03-17 18:07:55 +01:00
</div>
<!-- /.col (LEFT) -->
<div class="col-md-6">
<!-- LINE CHART -->
<div class="card card-info">
<div class="card-header">
<h3 class="card-title">Line Chart</h3>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
2015-09-19 20:05:54 +02:00
</div>
2018-03-17 18:07:55 +01:00
<div class="card-body">
<div class="chart">
<canvas id="lineChart" style="height:250px"></canvas>
</div>
2015-09-19 20:05:54 +02:00
</div>
2018-03-17 18:07:55 +01:00
<!-- /.card-body -->
2015-09-19 20:05:54 +02:00
</div>
2018-03-17 18:07:55 +01:00
<!-- /.card -->
2015-04-04 03:19:55 +02:00
2018-03-17 18:07:55 +01:00
<!-- BAR CHART -->
<div class="card card-success">
<div class="card-header">
<h3 class="card-title">Bar Chart</h3>
2015-09-19 20:05:54 +02:00
2018-03-17 18:07:55 +01:00
<div class="card-tools">
<button type="button" class="btn btn-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
2015-09-19 20:05:54 +02:00
</div>
2018-03-17 18:07:55 +01:00
<div class="card-body">
<div class="chart">
<canvas id="barChart" style="height:230px"></canvas>
</div>
2015-09-19 20:05:54 +02:00
</div>
2018-03-17 18:07:55 +01:00
<!-- /.card-body -->
2015-09-19 20:05:54 +02:00
</div>
2018-03-17 18:07:55 +01:00
<!-- /.card -->
2015-04-04 03:19:55 +02:00
2018-03-17 18:07:55 +01:00
</div>
<!-- /.col (RIGHT) -->
2015-04-04 03:19:55 +02:00
</div>
2018-03-17 18:07:55 +01:00
<!-- /.row -->
</div><!-- /.container-fluid -->
2015-09-19 20:05:54 +02:00
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<footer class="main-footer">
2018-03-17 18:07:55 +01:00
<div class="float-right d-none d-sm-block">
<b>Version</b> 3.0.0-alpha
2015-09-19 20:05:54 +02:00
</div>
2018-03-17 18:07:55 +01:00
<strong>Copyright &copy; 2014-2018 <a href="http://adminlte.io">AdminLTE.io</a>.</strong> All rights
2015-09-19 20:05:54 +02:00
reserved.
</footer>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
2018-04-15 01:33:53 +02:00
<!-- Add Content Here -->
2015-09-19 20:05:54 +02:00
</aside>
<!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
2018-03-17 18:07:55 +01:00
<!-- jQuery -->
<script src="../../plugins/jquery/jquery.min.js"></script>
2018-02-04 00:45:19 +01:00
<!-- Bootstrap 4 -->
2018-03-17 18:07:55 +01:00
<script src="../../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
2015-09-19 20:05:54 +02:00
<!-- ChartJS 1.0.1 -->
2018-04-15 01:33:53 +02:00
<script src="../../plugins/chartjs-old/Chart.min.js"></script>
2015-09-19 20:05:54 +02:00
<!-- FastClick -->
<script src="../../plugins/fastclick/fastclick.js"></script>
2015-09-19 20:05:54 +02:00
<!-- AdminLTE App -->
2018-03-17 18:07:55 +01:00
<script src="../../dist/js/adminlte.min.js"></script>
2015-09-19 20:05:54 +02:00
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<!-- page script -->
<script>
$(function () {
/* ChartJS
* -------
* Here we will create a few charts using ChartJS
*/
//--------------
//- AREA CHART -
//--------------
// Get context with jQuery - using jQuery's .get() method.
2018-03-17 18:07:55 +01:00
var areaChartCanvas = $('#areaChart').get(0).getContext('2d')
2015-09-19 20:05:54 +02:00
// This will get the first returned node in the jQuery collection.
2018-03-17 18:07:55 +01:00
var areaChart = new Chart(areaChartCanvas)
2015-09-19 20:05:54 +02:00
var areaChartData = {
2018-03-17 18:07:55 +01:00
labels : ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
2015-09-19 20:05:54 +02:00
datasets: [
{
2018-03-17 18:07:55 +01:00
label : 'Electronics',
fillColor : 'rgba(210, 214, 222, 1)',
strokeColor : 'rgba(210, 214, 222, 1)',
pointColor : 'rgba(210, 214, 222, 1)',
pointStrokeColor : '#c1c7d1',
pointHighlightFill : '#fff',
pointHighlightStroke: 'rgba(220,220,220,1)',
data : [65, 59, 80, 81, 56, 55, 40]
2015-09-19 20:05:54 +02:00
},
{
2018-03-17 18:07:55 +01:00
label : 'Digital Goods',
fillColor : 'rgba(60,141,188,0.9)',
strokeColor : 'rgba(60,141,188,0.8)',
pointColor : '#3b8bba',
pointStrokeColor : 'rgba(60,141,188,1)',
pointHighlightFill : '#fff',
pointHighlightStroke: 'rgba(60,141,188,1)',
data : [28, 48, 40, 19, 86, 27, 90]
2015-09-19 20:05:54 +02:00
}
]
2018-03-17 18:07:55 +01:00
}
2015-09-19 20:05:54 +02:00
var areaChartOptions = {
//Boolean - If we should show the scale at all
2018-03-17 18:07:55 +01:00
showScale : true,
2015-09-19 20:05:54 +02:00
//Boolean - Whether grid lines are shown across the chart
2018-03-17 18:07:55 +01:00
scaleShowGridLines : false,
2015-09-19 20:05:54 +02:00
//String - Colour of the grid lines
2018-03-17 18:07:55 +01:00
scaleGridLineColor : 'rgba(0,0,0,.05)',
2015-09-19 20:05:54 +02:00
//Number - Width of the grid lines
2018-03-17 18:07:55 +01:00
scaleGridLineWidth : 1,
2015-09-19 20:05:54 +02:00
//Boolean - Whether to show horizontal lines (except X axis)
scaleShowHorizontalLines: true,
//Boolean - Whether to show vertical lines (except Y axis)
2018-03-17 18:07:55 +01:00
scaleShowVerticalLines : true,
2015-09-19 20:05:54 +02:00
//Boolean - Whether the line is curved between points
2018-03-17 18:07:55 +01:00
bezierCurve : true,
2015-09-19 20:05:54 +02:00
//Number - Tension of the bezier curve between points
2018-03-17 18:07:55 +01:00
bezierCurveTension : 0.3,
2015-09-19 20:05:54 +02:00
//Boolean - Whether to show a dot for each point
2018-03-17 18:07:55 +01:00
pointDot : false,
2015-09-19 20:05:54 +02:00
//Number - Radius of each point dot in pixels
2018-03-17 18:07:55 +01:00
pointDotRadius : 4,
2015-09-19 20:05:54 +02:00
//Number - Pixel width of point dot stroke
2018-03-17 18:07:55 +01:00
pointDotStrokeWidth : 1,
2015-09-19 20:05:54 +02:00
//Number - amount extra to add to the radius to cater for hit detection outside the drawn point
2018-03-17 18:07:55 +01:00
pointHitDetectionRadius : 20,
2015-09-19 20:05:54 +02:00
//Boolean - Whether to show a stroke for datasets
2018-03-17 18:07:55 +01:00
datasetStroke : true,
2015-09-19 20:05:54 +02:00
//Number - Pixel width of dataset stroke
2018-03-17 18:07:55 +01:00
datasetStrokeWidth : 2,
2015-09-19 20:05:54 +02:00
//Boolean - Whether to fill the dataset with a color
2018-03-17 18:07:55 +01:00
datasetFill : true,
2015-09-19 20:05:54 +02:00
//String - A legend template
2018-03-17 18:07:55 +01:00
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>',
2015-09-19 20:05:54 +02:00
//Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
2018-03-17 18:07:55 +01:00
maintainAspectRatio : true,
2015-09-19 20:05:54 +02:00
//Boolean - whether to make the chart responsive to window resizing
2018-03-17 18:07:55 +01:00
responsive : true
}
2015-09-19 20:05:54 +02:00
//Create the line chart
2018-03-17 18:07:55 +01:00
areaChart.Line(areaChartData, areaChartOptions)
2015-09-19 20:05:54 +02:00
//-------------
//- LINE CHART -
//--------------
2018-03-17 18:07:55 +01:00
var lineChartCanvas = $('#lineChart').get(0).getContext('2d')
var lineChart = new Chart(lineChartCanvas)
var lineChartOptions = areaChartOptions
lineChartOptions.datasetFill = false
lineChart.Line(areaChartData, lineChartOptions)
2015-09-19 20:05:54 +02:00
//-------------
//- PIE CHART -
//-------------
// Get context with jQuery - using jQuery's .get() method.
2018-03-17 18:07:55 +01:00
var pieChartCanvas = $('#pieChart').get(0).getContext('2d')
var pieChart = new Chart(pieChartCanvas)
var PieData = [
2015-09-19 20:05:54 +02:00
{
2018-03-17 18:07:55 +01:00
value : 700,
color : '#f56954',
highlight: '#f56954',
label : 'Chrome'
2015-09-19 20:05:54 +02:00
},
{
2018-03-17 18:07:55 +01:00
value : 500,
color : '#00a65a',
highlight: '#00a65a',
label : 'IE'
2015-09-19 20:05:54 +02:00
},
{
2018-03-17 18:07:55 +01:00
value : 400,
color : '#f39c12',
highlight: '#f39c12',
label : 'FireFox'
2015-09-19 20:05:54 +02:00
},
{
2018-03-17 18:07:55 +01:00
value : 600,
color : '#00c0ef',
highlight: '#00c0ef',
label : 'Safari'
2015-09-19 20:05:54 +02:00
},
{
2018-03-17 18:07:55 +01:00
value : 300,
color : '#3c8dbc',
highlight: '#3c8dbc',
label : 'Opera'
2015-09-19 20:05:54 +02:00
},
{
2018-03-17 18:07:55 +01:00
value : 100,
color : '#d2d6de',
highlight: '#d2d6de',
label : 'Navigator'
2015-09-19 20:05:54 +02:00
}
2018-03-17 18:07:55 +01:00
]
var pieOptions = {
2015-09-19 20:05:54 +02:00
//Boolean - Whether we should show a stroke on each segment
2018-03-17 18:07:55 +01:00
segmentShowStroke : true,
2015-09-19 20:05:54 +02:00
//String - The colour of each segment stroke
2018-03-17 18:07:55 +01:00
segmentStrokeColor : '#fff',
2015-09-19 20:05:54 +02:00
//Number - The width of each segment stroke
2018-03-17 18:07:55 +01:00
segmentStrokeWidth : 2,
2015-09-19 20:05:54 +02:00
//Number - The percentage of the chart that we cut out of the middle
percentageInnerCutout: 50, // This is 0 for Pie charts
//Number - Amount of animation steps
2018-03-17 18:07:55 +01:00
animationSteps : 100,
2015-09-19 20:05:54 +02:00
//String - Animation easing effect
2018-03-17 18:07:55 +01:00
animationEasing : 'easeOutBounce',
2015-09-19 20:05:54 +02:00
//Boolean - Whether we animate the rotation of the Doughnut
2018-03-17 18:07:55 +01:00
animateRotate : true,
2015-09-19 20:05:54 +02:00
//Boolean - Whether we animate scaling the Doughnut from the centre
2018-03-17 18:07:55 +01:00
animateScale : false,
2015-09-19 20:05:54 +02:00
//Boolean - whether to make the chart responsive to window resizing
2018-03-17 18:07:55 +01:00
responsive : true,
2015-09-19 20:05:54 +02:00
// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
2018-03-17 18:07:55 +01:00
maintainAspectRatio : true,
2015-09-19 20:05:54 +02:00
//String - A legend template
2018-03-17 18:07:55 +01:00
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>'
}
2015-09-19 20:05:54 +02:00
//Create pie or douhnut chart
// You can switch between pie and douhnut using the method below.
2018-03-17 18:07:55 +01:00
pieChart.Doughnut(PieData, pieOptions)
2015-09-19 20:05:54 +02:00
//-------------
//- BAR CHART -
//-------------
2018-03-17 18:07:55 +01:00
var barChartCanvas = $('#barChart').get(0).getContext('2d')
var barChart = new Chart(barChartCanvas)
var barChartData = areaChartData
barChartData.datasets[1].fillColor = '#00a65a'
barChartData.datasets[1].strokeColor = '#00a65a'
barChartData.datasets[1].pointColor = '#00a65a'
var barChartOptions = {
2015-09-19 20:05:54 +02:00
//Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
2018-03-17 18:07:55 +01:00
scaleBeginAtZero : true,
2015-09-19 20:05:54 +02:00
//Boolean - Whether grid lines are shown across the chart
2018-03-17 18:07:55 +01:00
scaleShowGridLines : true,
2015-09-19 20:05:54 +02:00
//String - Colour of the grid lines
2018-03-17 18:07:55 +01:00
scaleGridLineColor : 'rgba(0,0,0,.05)',
2015-09-19 20:05:54 +02:00
//Number - Width of the grid lines
2018-03-17 18:07:55 +01:00
scaleGridLineWidth : 1,
2015-09-19 20:05:54 +02:00
//Boolean - Whether to show horizontal lines (except X axis)
scaleShowHorizontalLines: true,
//Boolean - Whether to show vertical lines (except Y axis)
2018-03-17 18:07:55 +01:00
scaleShowVerticalLines : true,
2015-09-19 20:05:54 +02:00
//Boolean - If there is a stroke on each bar
2018-03-17 18:07:55 +01:00
barShowStroke : true,
2015-09-19 20:05:54 +02:00
//Number - Pixel width of the bar stroke
2018-03-17 18:07:55 +01:00
barStrokeWidth : 2,
2015-09-19 20:05:54 +02:00
//Number - Spacing between each of the X value sets
2018-03-17 18:07:55 +01:00
barValueSpacing : 5,
2015-09-19 20:05:54 +02:00
//Number - Spacing between data sets within X values
2018-03-17 18:07:55 +01:00
barDatasetSpacing : 1,
2015-09-19 20:05:54 +02:00
//String - A legend template
2018-03-17 18:07:55 +01:00
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>',
2015-09-19 20:05:54 +02:00
//Boolean - whether to make the chart responsive
2018-03-17 18:07:55 +01:00
responsive : true,
maintainAspectRatio : true
}
2015-09-19 20:05:54 +02:00
2018-03-17 18:07:55 +01:00
barChartOptions.datasetFill = false
barChart.Bar(barChartData, barChartOptions)
})
2015-09-19 20:05:54 +02:00
</script>
</body>
2015-02-11 01:53:16 +01:00
</html>