-
Notifications
You must be signed in to change notification settings - Fork 4
/
highchart.php
81 lines (76 loc) · 2.62 KB
/
highchart.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<?php
$con = mysqli_connect("localhost","root","","elmouna");
?>
<html>
<head>
<?php include('include/head.php'); ?>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['bar']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['qte', 'scanby','doneby'],
<?php
$sql = "SELECT * FROM tasks";
$fire = mysqli_query($con,$sql);
while ($result = mysqli_fetch_assoc($fire)) {
echo"['".$result['doneby']."','".$result['scanby']."',".$result['qte']."],";
}
?>
]);
var options = {
chart: {
title: 'Company Performance',
},
bars: 'horizontal' // Required for Material Bar Charts.
};
var chart = new google.charts.Bar(document.getElementById('barchart_material'));
chart.draw(data, google.charts.Bar.convertOptions(options));
}
</script>
</head>
<body>
<?php include('include/header.php'); ?>
<?php include('include/sidebar.php'); ?>
<div class="main-container">
<div class="pd-ltr-20 customscroll customscroll-10-p height-100-p xs-pd-20-10">
<div class="min-height-200px">
<div class="page-header">
<div class="row">
<div class="col-md-6 col-sm-12">
<div class="title">
<h4>Charts</h4>
</div>
<nav aria-label="breadcrumb" role="navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Charts</li>
</ol>
</nav>
</div>
<div class="col-md-6 col-sm-12 text-right">
<div class="dropdown">
<a class="btn btn-primary dropdown-toggle" href="#" role="button" data-toggle="dropdown">
January 2018
</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="#">Export List</a>
<a class="dropdown-item" href="#">Policies</a>
<a class="dropdown-item" href="#">View Assets</a>
</div>
</div>
</div>
</div>
</div>
<div id="barchart_material" style="width: 900px; height: 500px;"></div>
</div>
<?php include('include/footer.php'); ?>
</div>
</div>
<?php include('include/script.php'); ?>
<script src="src/plugins/jQuery-Knob-master/js/jquery.knob.js"></script>
</body>
</html>