-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgraph.php
61 lines (60 loc) · 1.52 KB
/
graph.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
<?php
/**
* PHP Monitoring graph page : show services graphics
*/
require_once('functions.php');
$p = new PHPMonitoring();
?>
<!DOCTYPE html>
<html style="height: 100%;">
<head>
<title>PHP monitoring graph</title>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
</head>
<body style="height: 100%;">
<div id="container" style="width: 100%; height: 100%;"></div>
<script>
$(document).ready(function(){
$('#container').highcharts({
chart: {
type: 'column',
zoomType: 'x'
},
title: {
text: 'PHP monitoring graph'
},
xAxis: {
type: 'datetime',
startOnTick: true,
endOnTick: true,
minTickInterval: 60000
},
yAxis: {
title: {
text: 'down'
},
min: 0,
max: 1
},
plotOptions: {
series: {
pointPadding: 0,
groupPadding: 0,
borderWidth: 0,
shadow: false
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: <?= json_encode($tmp = $p->getLogData()) ?>
});
});
</script>
</body>
</html>