mirror of
https://github.com/Hopiu/webapi-eca.git
synced 2026-03-16 22:10:31 +00:00
41 lines
No EOL
1.5 KiB
HTML
41 lines
No EOL
1.5 KiB
HTML
|
|
<html>
|
|
<head>
|
|
|
|
<script type="text/javascript"
|
|
src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['corechart']}]}"></script>
|
|
|
|
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'></script>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
google.setOnLoadCallback(drawChart);
|
|
var dateNow = new Date()
|
|
function drawChart() {
|
|
$.getJSON('data/histochart.json', function(d) {
|
|
var data = new google.visualization.DataTable();
|
|
data.addColumn('datetime', 'Time');
|
|
data.addColumn('number', '# Responding');
|
|
|
|
var options_lines = {
|
|
title: 'Host Uptime Statistics',
|
|
curveType:'function',
|
|
lineWidth: 2,
|
|
intervals: { 'style':'line' },
|
|
legend: 'none',
|
|
vAxis: { title: "Number of Responding Hosts" },
|
|
hAxis: { title: "Timestamp", format: "MMM d, HH" }
|
|
};
|
|
var dat = d.pingtimes;
|
|
for(var prop in dat) {
|
|
data.addRow([new Date(prop), dat[prop].sum ]);
|
|
}
|
|
var chart_lines = new google.visualization.LineChart(document.getElementById('chart_lines'));
|
|
chart_lines.draw(data, options_lines);
|
|
});
|
|
setTimeout(drawChart, 3 * 60 * 1000);
|
|
}
|
|
</script>
|
|
<div id="chart_lines" style="width: 900px; height: 500px;"></div>
|
|
</body>
|
|
</html> |