<html>
<head>
<title>xxxxxxxxxxxxxxxxx</title>
<link rel="stylesheet" type="text/css" href="./css/style.css" />
<link rel="stylesheet" href="mystyle.css">
<meta http-equiv="refresh" content="80; URL=http://xxxx">
<!--Load the AJAX API-->
<script type="text/javascript"
src="https://www.google.com/jsapi"></script>
<script type="text/javascript"
src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);
var ticksArray = [{v: 1, f: '26.11.15'}, {v: 2, f: '09.12.15'}, {v: 3, f:
'22.12.15'}, {v: 4, f: '13.01.16'}, {v: 5, f: '27.01.16'}, {v: 6, f:
'17.02.16'}, {v: 7, f: '02.03.16'}, {v: 8, f: '16.03.16'}, {v: 9, f:
'14.04.16'}, {v: 10, f: '11.05.16'}, {v: 11, f: '04.08.16'}, {v: 12, f:
'07.09.16'}, {v: 13, f: '08.12.16'}, {v: 14, f: '19.12.16'}, {v: 15, f:
'22.12.16'}, {v: 16, f: '05.04.17'}, {v: 17, f: '11.05.17'}, {v: 18, f:
'08.06.17'}, {v: 19, f: '13.07.17'}, {v: 20, f: '28.07.17'}, {v: 21, f:
'26.07.18'}, {v: 22, f: '08.08.18'}, {v: 23, f: '29.08.18'}];
var Eingabe = "";
var Zaehler = 1;
while (Zaehler <= 3) {
Zaehler++;
function drawChart() {
var jsonData = $.ajax({
url: "Antwortzeiten_XXX.php?",
dataType:"json",
async: false
}).responseText;
// Create our data table out of JSON data loaded from server.
var data = new google.visualization.DataTable(jsonData);
// Instantiate and draw our chart, passing in some options.
var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, {width: 800, height: 240});
}
window.setTimeout(drawChart(), 10000);
}
</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<!--Div that will hold the pie chart-->
<div id="chart_start_div">
<script>
function drawChart() {
var jsonData = $.ajax({
url: "XXXXXXX.php?seite=Start",
dataType:"json",
async: false
}).responseText;
// Create our data table out of JSON data loaded from server.
var data = new google.visualization.DataTable(jsonData);
// Instantiate and draw our chart, passing in some options.
var chart = new
google.visualization.LineChart(document.getElementById('chart_start_div'));
chart.draw(data, {explorer:{axis: 'horizontal'}, width: 800, height:
240, hAxis: {ticks: ticksArray}});
}
window.setTimeout(drawChart(), 10000);
</script>
</div>
</body>
</html>
The above code worked for years.
Now I get no graph anymore without any change by myself.
Maybe there was a change in Google graphs, which makes it necessary to
change the code?
In the line "var data = new google.visualization.DataTable(jsonData);" I
get the error "Uncaught TypeError: Cannot read property 'DataTable' of
undefined".
The php works fine to provide the JSON-Data.
The goal is, that the graph updates itself automatically every 10 seconds.
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/cc4ff6cf-55eb-4195-b67d-46775ef74964o%40googlegroups.com.