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