Commit | Line | Data |
---|---|---|
54425b14 | 1 | <!DOCTYPE html> |
d955e223 DV |
2 | <html> |
3 | <head> | |
93a5bb4c | 4 | <link rel="stylesheet" href="../css/dygraph.css"> |
d955e223 | 5 | <title>numeric axis</title> |
7e5ddc94 DV |
6 | <!-- |
7 | For production (minified) code, use: | |
8 | <script type="text/javascript" src="dygraph-combined.js"></script> | |
9 | --> | |
fbd6834a | 10 | <script type="text/javascript" src="../dist/dygraph.js"></script> |
7e5ddc94 | 11 | |
d955e223 DV |
12 | <script type="text/javascript" src="http://www.google.com/jsapi"></script> |
13 | </head> | |
14 | <body> | |
15 | <p>CSV data source:</p> | |
d16579a0 | 16 | <div id="div_g" style="width:600px; height:300px;"></div> |
d955e223 DV |
17 | |
18 | <p>GViz data source:</p> | |
19 | <div id="gviz" style="width:600px; height:300px;"></div> | |
20 | ||
21 | <script type="text/javascript"> | |
285a6bda | 22 | g = new Dygraph( |
d16579a0 | 23 | document.getElementById("div_g"), |
d955e223 DV |
24 | function() { |
25 | var ret = "X,Y1,Y2\n"; | |
26 | for (var i = 0; i < 100; i++) { | |
27 | ret += i + "," + i + "," + (i * (100-i) * 100/(50*50)) + "\n"; | |
28 | } | |
29 | return ret; | |
285a6bda DV |
30 | }, |
31 | { } | |
d955e223 DV |
32 | ); |
33 | ||
34 | google.load('visualization', '1', {packages: ['linechart']}); | |
35 | function addGViz() { | |
36 | data = new google.visualization.DataTable(); | |
37 | data.addColumn('number', 'X'); | |
38 | data.addColumn('number', 'Y1'); | |
39 | data.addColumn('number', 'Y2'); | |
40 | data.addRows(100); | |
41 | for (var i = 0; i < 100; i++) { | |
42 | data.setCell(i, 0, i); | |
43 | data.setCell(i, 1, i); | |
44 | data.setCell(i, 2, i * (100-i) * 100/(50*50)); | |
45 | } | |
46 | ||
285a6bda | 47 | new Dygraph.GVizChart( |
d955e223 DV |
48 | document.getElementById('gviz')).draw(data, |
49 | { | |
d955e223 DV |
50 | }); |
51 | } | |
52 | ||
53 | google.setOnLoadCallback(addGViz); | |
54 | </script> | |
55 | </body> | |
56 | </html> |