You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AdminLTE/pages/charts/flot.html

1016 lines
33 KiB

<!DOCTYPE html>
<html>
9 years ago
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>AdminLTE 3 | Flot Charts</title>
9 years ago
<!-- Tell the browser to be responsive to screen width -->
7 years ago
<meta name="viewport" content="width=device-width, initial-scale=1">
9 years ago
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
9 years ago
<!-- Ionicons -->
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<!-- Theme style -->
7 years ago
<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">
9 years ago
</head>
7 years ago
<body class="hold-transition sidebar-mini">
9 years ago
<div class="wrapper">
7 years ago
<!-- Navbar -->
<nav class="main-header navbar navbar-expand navbar-white navbar-light border-bottom">
7 years ago
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
7 years ago
</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>
9 years ago
7 years ago
<!-- 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="fas fa-search"></i>
7 years ago
</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="far fa-comments"></i>
7 years ago
<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="fas fa-star"></i></span>
7 years ago
</h3>
<p class="text-sm">Call me whenever you can...</p>
<p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p>
7 years ago
</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="fas fa-star"></i></span>
7 years ago
</h3>
<p class="text-sm">I got your message bro</p>
<p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p>
7 years ago
</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="fas fa-star"></i></span>
7 years ago
</h3>
<p class="text-sm">The subject goes here</p>
<p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p>
7 years ago
</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="far fa-bell"></i>
7 years ago
<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="fas fa-envelope mr-2"></i> 4 new messages
7 years ago
<span class="float-right text-muted text-sm">3 mins</span>
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">
<i class="fas fa-users mr-2"></i> 8 friend requests
7 years ago
<span class="float-right text-muted text-sm">12 hours</span>
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">
<i class="fas fa-file mr-2"></i> 3 new reports
7 years ago
<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="fas fa-th-large"></i>
7 years ago
</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>
9 years ago
</a>
7 years ago
<!-- Sidebar -->
<div class="sidebar">
7 years ago
<!-- 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 fas fa-tachometer-alt"></i>
7 years ago
<p>
Dashboard
<i class="right fas fa-angle-left"></i>
7 years ago
</p>
9 years ago
</a>
7 years ago
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../../index.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Dashboard v1</p>
</a>
</li>
<li class="nav-item">
<a href="../../index2.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Dashboard v2</p>
</a>
</li>
<li class="nav-item">
<a href="../../index3.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Dashboard v3</p>
</a>
</li>
9 years ago
</ul>
</li>
7 years ago
<li class="nav-item">
<a href="../widgets.html" class="nav-link">
<i class="nav-icon fas fa-th"></i>
7 years ago
<p>
Widgets
<span class="right badge badge-danger">New</span>
</p>
</a>
</li>
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-copy"></i>
<p>
Layout Options
<i class="fas fa-angle-left right"></i>
<span class="badge badge-info right">6</span>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../layout/top-nav.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Top Navigation</p>
</a>
</li>
<li class="nav-item">
<a href="../layout/boxed.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Boxed</p>
</a>
</li>
<li class="nav-item">
<a href="../layout/fixed.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Fixed</p>
</a>
</li>
<li class="nav-item">
<a href="../layout/fixed-topnav.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Fixed Navbar</p>
</a>
</li>
<li class="nav-item">
<a href="../layout/fixed-footer.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Fixed Footer</p>
</a>
</li>
<li class="nav-item">
<a href="../layout/collapsed-sidebar.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Collapsed Sidebar</p>
</a>
</li>
</ul>
</li>
7 years ago
<li class="nav-item has-treeview menu-open">
<a href="#" class="nav-link active">
<i class="nav-icon fas fa-chart-pie"></i>
7 years ago
<p>
Charts
<i class="right fas fa-angle-left"></i>
7 years ago
</p>
9 years ago
</a>
7 years ago
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="chartjs.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>ChartJS</p>
</a>
</li>
<li class="nav-item">
<a href="flot.html" class="nav-link active">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Flot</p>
</a>
</li>
<li class="nav-item">
<a href="inline.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Inline</p>
</a>
</li>
9 years ago
</ul>
</li>
7 years ago
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-tree"></i>
7 years ago
<p>
UI Elements
<i class="fas fa-angle-left right"></i>
7 years ago
</p>
9 years ago
</a>
7 years ago
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../UI/general.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>General</p>
</a>
</li>
<li class="nav-item">
<a href="../UI/icons.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Icons</p>
</a>
</li>
<li class="nav-item">
<a href="../UI/buttons.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Buttons</p>
</a>
</li>
7 years ago
<li class="nav-item">
<a href="../UI/sliders.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Sliders</p>
</a>
</li>
<li class="nav-item">
<a href="../UI/modals.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Modals & Alerts</p>
</a>
</li>
</ul>
9 years ago
</li>
7 years ago
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-edit"></i>
7 years ago
<p>
Forms
<i class="fas fa-angle-left right"></i>
7 years ago
</p>
9 years ago
</a>
7 years ago
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../forms/general.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>General Elements</p>
</a>
9 years ago
</li>
7 years ago
<li class="nav-item">
<a href="../forms/advanced.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Advanced Elements</p>
</a>
9 years ago
</li>
7 years ago
<li class="nav-item">
<a href="../forms/editors.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Editors</p>
</a>
9 years ago
</li>
</ul>
</li>
7 years ago
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-table"></i>
7 years ago
<p>
Tables
<i class="fas fa-angle-left right"></i>
7 years ago
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../tables/simple.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Simple Tables</p>
</a>
</li>
<li class="nav-item">
<a href="../tables/data.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Data Tables</p>
</a>
</li>
</ul>
</li>
<li class="nav-header">EXAMPLES</li>
<li class="nav-item">
<a href="../calendar.html" class="nav-link">
<i class="nav-icon far fa-calendar-alt"></i>
7 years ago
<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 far fa-envelope"></i>
7 years ago
<p>
Mailbox
<i class="fas fa-angle-left right"></i>
7 years ago
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../mailbox/mailbox.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Inbox</p>
</a>
</li>
<li class="nav-item">
<a href="../mailbox/compose.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Compose</p>
</a>
</li>
<li class="nav-item">
<a href="../mailbox/read-mail.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Read</p>
</a>
</li>
</ul>
</li>
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-book"></i>
7 years ago
<p>
Pages
<i class="fas fa-angle-left right"></i>
7 years ago
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../examples/invoice.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Invoice</p>
</a>
</li>
<li class="nav-item">
<a href="../examples/profile.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Profile</p>
</a>
</li>
<li class="nav-item">
<a href="../examples/login.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Login</p>
</a>
</li>
<li class="nav-item">
<a href="../examples/register.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Register</p>
</a>
</li>
<li class="nav-item">
<a href="../examples/lockscreen.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Lockscreen</p>
</a>
</li>
</ul>
</li>
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon far fa-plus-square"></i>
7 years ago
<p>
Extras
<i class="fas fa-angle-left right"></i>
7 years ago
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="../examples/404.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Error 404</p>
</a>
</li>
<li class="nav-item">
<a href="../examples/500.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Error 500</p>
</a>
</li>
<li class="nav-item">
<a href="../examples/blank.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Blank Page</p>
</a>
</li>
<li class="nav-item">
<a href="../../starter.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
7 years ago
<p>Starter Page</p>
</a>
</li>
<li class="nav-item">
<a href="../examples/legacy-user-menu.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Legacy User Menu</p>
</a>
</li>
7 years ago
</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 fas fa-file"></i>
7 years ago
<p>Documentation</p>
</a>
</li>
<li class="nav-header">LABELS</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon far fa-circle text-danger"></i>
7 years ago
<p class="text">Important</p>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon far fa-circle text-warning"></i>
7 years ago
<p>Warning</p>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon far fa-circle text-info"></i>
7 years ago
<p>Informational</p>
</a>
9 years ago
</li>
</ul>
7 years ago
</nav>
<!-- /.sidebar-menu -->
</div>
9 years ago
<!-- /.sidebar -->
</aside>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
7 years ago
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Flot Charts</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">Flot</li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
9 years ago
</section>
<!-- Main content -->
<section class="content">
7 years ago
<div class="container-fluid">
<div class="row">
<div class="col-12">
<!-- interactive chart -->
<div class="card card-primary card-outline">
<div class="card-header">
<h3 class="card-title">
<i class="far fa-chart-bar"></i>
7 years ago
Interactive Area Chart
</h3>
<div class="card-tools">
Real time
<div class="btn-group" id="realtime" data-toggle="btn-toggle">
<button type="button" class="btn btn-default btn-sm active" data-toggle="on">On</button>
<button type="button" class="btn btn-default btn-sm" data-toggle="off">Off</button>
</div>
</div>
9 years ago
</div>
7 years ago
<div class="card-body">
<div id="interactive" style="height: 300px;"></div>
9 years ago
</div>
7 years ago
<!-- /.card-body-->
9 years ago
</div>
7 years ago
<!-- /.card -->
9 years ago
</div>
7 years ago
<!-- /.col -->
</div>
7 years ago
<!-- /.row -->
<div class="row">
<div class="col-md-6">
<!-- Line chart -->
<div class="card card-primary card-outline">
<div class="card-header">
<h3 class="card-title">
<i class="far fa-chart-bar"></i>
7 years ago
Line Chart
</h3>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-widget="collapse"><i class="fas fa-minus"></i>
7 years ago
</button>
<button type="button" class="btn btn-tool" data-widget="remove"><i class="fas fa-times"></i>
7 years ago
</button>
</div>
9 years ago
</div>
7 years ago
<div class="card-body">
<div id="line-chart" style="height: 300px;"></div>
</div>
<!-- /.card-body-->
9 years ago
</div>
7 years ago
<!-- /.card -->
<!-- Area chart -->
<div class="card card-primary card-outline">
<div class="card-header">
<h3 class="card-title">
<i class="far fa-chart-bar"></i>
7 years ago
Area Chart
</h3>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-widget="collapse"><i class="fas fa-minus"></i>
7 years ago
</button>
<button type="button" class="btn btn-tool" data-widget="remove"><i class="fas fa-times"></i>
7 years ago
</button>
</div>
</div>
<div class="card-body">
<div id="area-chart" style="height: 338px;" class="full-width-chart"></div>
</div>
<!-- /.card-body-->
9 years ago
</div>
7 years ago
<!-- /.card -->
9 years ago
7 years ago
</div>
<!-- /.col -->
<div class="col-md-6">
<!-- Bar chart -->
<div class="card card-primary card-outline">
<div class="card-header">
<h3 class="card-title">
<i class="far fa-chart-bar"></i>
7 years ago
Bar Chart
</h3>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-widget="collapse">
<i class="fas fa-minus"></i>
7 years ago
</button>
<button type="button" class="btn btn-tool" data-widget="remove">
<i class="fas fa-times"></i>
7 years ago
</button>
</div>
9 years ago
</div>
7 years ago
<div class="card-body">
<div id="bar-chart" style="height: 300px;"></div>
</div>
<!-- /.card-body-->
9 years ago
</div>
7 years ago
<!-- /.card -->
<!-- Donut chart -->
<div class="card card-primary card-outline">
<div class="card-header">
<h3 class="card-title">
<i class="far fa-chart-bar"></i>
7 years ago
Donut Chart
</h3>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-widget="collapse"><i class="fas fa-minus"></i>
7 years ago
</button>
<button type="button" class="btn btn-tool" data-widget="remove"><i class="fas fa-times"></i>
7 years ago
</button>
</div>
</div>
<div class="card-body">
<div id="donut-chart" style="height: 300px;"></div>
</div>
<!-- /.card-body-->
9 years ago
</div>
7 years ago
<!-- /.card -->
9 years ago
</div>
7 years ago
<!-- /.col -->
9 years ago
</div>
7 years ago
<!-- /.row -->
</div><!-- /.container-fluid -->
9 years ago
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
7 years ago
9 years ago
<footer class="main-footer">
7 years ago
<div class="float-right d-none d-sm-block">
<b>Version</b> 3.0.0-beta.1
9 years ago
</div>
7 years ago
<strong>Copyright &copy; 2014-2018 <a href="http://adminlte.io">AdminLTE.io</a>.</strong> All rights
9 years ago
reserved.
</footer>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
9 years ago
</aside>
<!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
7 years ago
<!-- jQuery -->
<script src="../../plugins/jquery/jquery.min.js"></script>
<!-- jQuery UI -->
<script src="../../plugins/jquery-ui/jquery-ui.min.js"></script>
7 years ago
<!-- Bootstrap 4 -->
7 years ago
<script src="../../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
9 years ago
<!-- FastClick -->
<script src="../../plugins/fastclick/fastclick.js"></script>
9 years ago
<!-- AdminLTE App -->
7 years ago
<script src="../../dist/js/adminlte.min.js"></script>
9 years ago
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<!-- FLOT CHARTS -->
<script src="../../plugins/flot/jquery.flot.js"></script>
9 years ago
<!-- FLOT RESIZE PLUGIN - allows the chart to redraw when the window is resized -->
<script src="../../plugins/flot-old/jquery.flot.resize.min.js"></script>
9 years ago
<!-- FLOT PIE PLUGIN - also used to draw donut charts -->
<script src="../../plugins/flot-old/jquery.flot.pie.min.js"></script>
9 years ago
<!-- Page script -->
<script>
$(function () {
/*
* Flot Interactive Chart
* -----------------------
*/
// We use an inline data source in the example, usually data would
// be fetched from a server
7 years ago
var data = [],
totalPoints = 100
9 years ago
function getRandomData() {
7 years ago
if (data.length > 0) {
data = data.slice(1)
}
9 years ago
// Do a random walk
while (data.length < totalPoints) {
var prev = data.length > 0 ? data[data.length - 1] : 50,
7 years ago
y = prev + Math.random() * 10 - 5
9 years ago
if (y < 0) {
7 years ago
y = 0
9 years ago
} else if (y > 100) {
7 years ago
y = 100
}
7 years ago
data.push(y)
9 years ago
}
// Zip the generated y values with the x values
7 years ago
var res = []
9 years ago
for (var i = 0; i < data.length; ++i) {
7 years ago
res.push([i, data[i]])
9 years ago
}
7 years ago
return res
9 years ago
}
var interactive_plot = $.plot('#interactive', [
{
data: getRandomData(),
}
],
{
grid: {
borderColor: '#f3f3f3',
borderWidth: 1,
tickColor: '#f3f3f3'
},
series: {
color: '#3c8dbc',
lines: {
lineWidth: 2,
show: true,
fill: true,
},
},
yaxis: {
min: 0,
max: 100,
show: true
},
xaxis: {
show: true
}
9 years ago
}
)
9 years ago
7 years ago
var updateInterval = 500 //Fetch data ever x milliseconds
var realtime = 'on' //If == to on then fetch data every x seconds. else stop fetching
9 years ago
function update() {
7 years ago
interactive_plot.setData([getRandomData()])
9 years ago
// Since the axes don't change, we don't need to call plot.setupGrid()
7 years ago
interactive_plot.draw()
if (realtime === 'on') {
setTimeout(update, updateInterval)
}
9 years ago
}
//INITIALIZE REALTIME DATA FETCHING
7 years ago
if (realtime === 'on') {
update()
9 years ago
}
//REALTIME TOGGLE
7 years ago
$('#realtime .btn').click(function () {
if ($(this).data('toggle') === 'on') {
realtime = 'on'
9 years ago
}
else {
7 years ago
realtime = 'off'
9 years ago
}
7 years ago
update()
})
9 years ago
/*
* END INTERACTIVE CHART
*/
/*
* LINE CHART
* ----------
*/
//LINE randomly generated data
7 years ago
var sin = [],
cos = []
9 years ago
for (var i = 0; i < 14; i += 0.5) {
7 years ago
sin.push([i, Math.sin(i)])
cos.push([i, Math.cos(i)])
9 years ago
}
var line_data1 = {
7 years ago
data : sin,
color: '#3c8dbc'
}
9 years ago
var line_data2 = {
7 years ago
data : cos,
color: '#00c0ef'
}
$.plot('#line-chart', [line_data1, line_data2], {
grid : {
hoverable : true,
borderColor: '#f3f3f3',
9 years ago
borderWidth: 1,
7 years ago
tickColor : '#f3f3f3'
9 years ago
},
series: {
shadowSize: 0,
7 years ago
lines : {
9 years ago
show: true
},
7 years ago
points : {
9 years ago
show: true
}
9 years ago
},
7 years ago
lines : {
fill : false,
color: ['#3c8dbc', '#f56954']
9 years ago
},
7 years ago
yaxis : {
show: true
9 years ago
},
7 years ago
xaxis : {
9 years ago
show: true
}
7 years ago
})
9 years ago
//Initialize tooltip on hover
$('<div class="tooltip-inner" id="line-chart-tooltip"></div>').css({
7 years ago
position: 'absolute',
display : 'none',
opacity : 0.8
}).appendTo('body')
$('#line-chart').bind('plothover', function (event, pos, item) {
9 years ago
if (item) {
var x = item.datapoint[0].toFixed(2),
7 years ago
y = item.datapoint[1].toFixed(2)
$('#line-chart-tooltip').html(item.series.label + ' of ' + x + ' = ' + y)
.css({
top : item.pageY + 5,
left: item.pageX + 5
})
.fadeIn(200)
9 years ago
} else {
7 years ago
$('#line-chart-tooltip').hide()
9 years ago
}
7 years ago
})
9 years ago
/* END LINE CHART */
/*
* FULL WIDTH STATIC AREA CHART
* -----------------
*/
var areaData = [[2, 88.0], [3, 93.3], [4, 102.0], [5, 108.5], [6, 115.7], [7, 115.6],
[8, 124.6], [9, 130.3], [10, 134.3], [11, 141.4], [12, 146.5], [13, 151.7], [14, 159.9],
7 years ago
[15, 165.4], [16, 167.8], [17, 168.7], [18, 169.5], [19, 168.0]]
$.plot('#area-chart', [areaData], {
grid : {
9 years ago
borderWidth: 0
},
series: {
shadowSize: 0, // Drawing is faster without shadows
color : '#00c0ef',
lines : {
fill: true //Converts the line chart to area chart
},
9 years ago
},
7 years ago
yaxis : {
9 years ago
show: false
},
7 years ago
xaxis : {
9 years ago
show: false
}
7 years ago
})
9 years ago
/* END AREA CHART */
/*
* BAR CHART
* ---------
*/
var bar_data = {
data : [[1,10], [2,8], [3,4], [4,13], [5,17], [6,9]],
bars: { show: true }
7 years ago
}
$.plot('#bar-chart', [bar_data], {
grid : {
9 years ago
borderWidth: 1,
7 years ago
borderColor: '#f3f3f3',
tickColor : '#f3f3f3'
9 years ago
},
series: {
bars: {
show: true, barWidth: 0.5, align: 'center',
},
9 years ago
},
colors: ['#3c8dbc'],
7 years ago
xaxis : {
ticks: [[1,'January'], [2,'February'], [3,'March'], [4,'April'], [5,'May'], [6,'June']]
9 years ago
}
7 years ago
})
9 years ago
/* END BAR CHART */
/*
* DONUT CHART
* -----------
*/
var donutData = [
7 years ago
{
label: 'Series2',
data : 30,
color: '#3c8dbc'
},
{
label: 'Series3',
data : 20,
color: '#0073b7'
},
{
label: 'Series4',
data : 50,
color: '#00c0ef'
}
]
$.plot('#donut-chart', donutData, {
9 years ago
series: {
pie: {
7 years ago
show : true,
radius : 1,
9 years ago
innerRadius: 0.5,
7 years ago
label : {
show : true,
radius : 2 / 3,
9 years ago
formatter: labelFormatter,
threshold: 0.1
}
9 years ago
}
},
legend: {
show: false
}
7 years ago
})
9 years ago
/*
* END DONUT CHART
*/
7 years ago
})
9 years ago
/*
* Custom Label formatter
* ----------------------
*/
function labelFormatter(label, series) {
return '<div style="font-size:13px; text-align:center; padding:2px; color: #fff; font-weight: 600;">'
7 years ago
+ label
+ '<br>'
+ Math.round(series.percent) + '%</div>'
9 years ago
}
</script>
</body>
</html>