-
Notifications
You must be signed in to change notification settings - Fork 0
/
tempdata.html
44 lines (40 loc) · 1.68 KB
/
tempdata.html
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
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var jsonData = $.ajax({
url: "tempdata.php",
dataType: "json",
async: false
}).responseText;
var data = new google.visualization.DataTable(jsonData);
var options = {
title:"",
legend: { position: 'top', textStyle: {color: 'black', fontSize: 12} },
colors: ['red','blue'],
width: 900,
height: 600,
enableInteractivity: false,
chartArea: { width: '85%' },
vAxis: { title: "Temperature, degrees", viewWindow: { min: 20, max: 125},gridlines: {count: 16},minorGridlines: {count:1} },
hAxis: { // time-axis
title: "Date/Time",
//viewWindow: { min: new Date(2017, 0, 27, 18), max: new Date(2017, 0, 27, 20) },
gridlines: { count: -1, units: { days: {format: ['MMM dd']}, hours: {format: ['HH:mm', 'ha']}, } },
minorGridlines: { units: { hours: {format: ['hh:mm:ss a', 'ha']}, minutes: {format: ['HH:mm a Z', ':mm']} } }
}
};
var chart = new google.visualization.LineChart( document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>
<body>
<h2 style="text-align: center;">Rocce rack temperature log</h2>
<div id="chart_div" style="width: 900px; height: 500px"></div>
</body>
</html>