forked from loadavg/loadavg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchartavg.php
123 lines (95 loc) · 3.06 KB
/
chartavg.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
/**
* LoadAvg - Server Monitoring & Analytics
* http://www.loadavg.com
*
* Charting core for LoadAvg included by charts.php
* used in main charts and override modules
*
* @version SVN: $Id$
* @link https://github.com/loadavg/loadavg
* @author Karsten Becker
* @copyright 2014 Sputnik7
*
* This file is licensed under the Affero General Public License version 3 or
* later.
*/
?>
<script type="text/javascript">
(function () {
var options = {
grid: {
show: true,
//color: "#efefef",
color: "#EEE",
axisMargin: 0,
borderWidth: 1,
hoverable: true,
autoHighlight: true,
aboveData: true,
//labelMargin: 5,
borderWidth: 1,
//minBorderMargin: 5 ,
clickable: true,
mouseActiveRadius: 20,
borderColor: "#797979",
backgroundColor : "#353535"
},
series: {
bars: {
show: true,
barWidth: 2,
fillColor: {colors:[{opacity: 1},{opacity: 1}]},
align: "center"
},
color: "#26ADE4",
stack: 0
},
width: 1.5,
xaxis: {
font: { size:10, color: "white", variant:"small-caps" },
show: true,
min: 0, max: 2,
ticks: [ [1, "AVG"] ],
tickLength: 0,
//alignTicksWithAxis: 1,
color: "grey",
axisLabel: "AVG",
axisLabelFontSizePixels: 8,
//axisLabelFontSize: 8,
axisLabelFontFamily: 'Verdana, Arial',
//axisLabelPadding: 3
},
yaxis: {
show: false,
max: <?php echo $chartData['chart']['ymax']; ?>,
min: <?php echo $chartData['chart']['ymin'];?>,
reserveSpace: false,
labelWidth: 15
},
legend: {
show: false
},
tooltip: true,
tooltipOpts: {
content: function(label, xval, yval, flotItem) {
return "Avg " + parseFloat(yval).toFixed(4);
},
shifts: {
x: 20,
y: -20
},
defaultTheme: false
}
};
$(function () {
$("#minmax_<?php echo $chart->id; ?>").width(45).height(162);
$.plot($("#minmax_<?php echo $chart->id; ?>"),[[[1, <?php echo $chartData['chart']['mean']; ?>]]],options);
})
})();
</script>
<!--
<div id="minmax_<?php echo $chart->id; ?>" style="width:45px; height:176px;top: 18px;right: 5px;"></div>
<div id="minmax_<?php echo $chart->id; ?>" class="pull-right innerLR" style="right: 5px; top: 15px;"></div>
-->
<div id="minmax_<?php echo $chart->id; ?>" class="pull-right innerLR" style="height: <?php echo $chartHeight;?>px; right: 5px; top: 12px;" class="chart-holder"></div>