-
Notifications
You must be signed in to change notification settings - Fork 0
/
teste_json.php
executable file
·52 lines (47 loc) · 1.21 KB
/
teste_json.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
<!DOCTYPE html>
<html>
<head>
<title>Frozen Waves</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link rel="manifest" href="manifest.json">
<link rel="stylesheet" type="text/css" href="css/c3.min.css">
<link rel="stylesheet" type="text/css" href="css/estilo.css">
</head>
<body class="">
<div id="chart">
</div>
</body>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/d3.min.js"></script>
<script type="text/javascript" src="js/c3.min.js"></script>
<script type="text/javascript">
var col1 = ['col1'],
col2 = ['col2'];
$.getJSON("./json/teste_8.json", function (resultado) {
// console.log(resultado[0]);
console.log(resultado[1]);
$.each(resultado[1], function (index, value, ){
// console.log("index:"+index+" value: "+value);
console.log(this);
col1.push(this[0]);
col2.push(this[1]);
});
var chart = c3.generate({
data: {
columns:[
col1,
col2
]
}
});
});
// var chart = c3.generate({
// data: {
// columns:[
// ],
// type:'spline'
// }
// });
</script>
</html>