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