-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph.php
60 lines (47 loc) · 1.87 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
<html lang="de">
<head>
<meta charset="utf-8">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<?php
$results = array(array(10,14,15,18,20,42),array(40,41,42,44,45,46));
?>
<script type="text/javascript">
var results = <?php echo json_encode($results); ?>; // [[1, 2, 3, 4, 5, 6]]
console.log(results)
var hits = <?php echo $hits; ?>; // [1]
var misses = <?php echo $misses; ?>; // [5]
var victoryState = <?php echo $victoryState; ?>; // [0]*/
var occurrences = "<?php echo json_encode($occurrences); ?>"; // i = Zahl - 1 [i] = Häufigkeit Zahl
</script>
<script type="text/javascript">
google.charts.load('current', {'packages':['bar']});
google.charts.setOnLoadCallback(drawChart);
var bspArray1 = [['Zahlen', 'Gewinne', 'Nieten'],[20, 30, 40],[20, 30, 40],[20, 30, 40],[20, 30, 40]];
var chartArray = [['Häufigkeiten']]
chartArray.push(occurrences)
function drawChart() {
var data = google.visualization.arrayToDataTable(
chartArray);
var options = {
chart: {
title: 'Lotto Auswertung',
subtitle: 'Welche Zahlen haben wie oft gezogen',
'height': 800,
'width': 400,
"chartArea": {
"width":'100%',
"height":'100%'
}
}
};
var chart = new google.charts.Bar(document.getElementById('columnchart_wins_per_num'));
chart.draw(data, google.charts.Bar.convertOptions(options));
}
</script>
<title>Graph für IFrame</title>
</head>
<body>
<div id="columnchart_wins_per_num" style="width: 800px; height: 400px;"></div>
</body>
</html>