Merge branch 'master' of https://github.com/kberg/dygraphs
[dygraphs.git] / tests / numeric-axis.html
CommitLineData
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]-->
d37dca40
DV
9 <script type="text/javascript" src="../strftime/strftime-min.js"></script>
10 <script type="text/javascript" src="../rgbcolor/rgbcolor.js"></script>
285a6bda 11 <script type="text/javascript" src="../dygraph-canvas.js"></script>
d955e223
DV
12 <script type="text/javascript" src="../dygraph.js"></script>
13 <script type="text/javascript" src="http://www.google.com/jsapi"></script>
14 </head>
15 <body>
16 <p>CSV data source:</p>
d16579a0 17 <div id="div_g" style="width:600px; height:300px;"></div>
d955e223
DV
18
19 <p>GViz data source:</p>
20 <div id="gviz" style="width:600px; height:300px;"></div>
21
22 <script type="text/javascript">
285a6bda 23 g = new Dygraph(
d16579a0 24 document.getElementById("div_g"),
d955e223
DV
25 function() {
26 var ret = "X,Y1,Y2\n";
27 for (var i = 0; i < 100; i++) {
28 ret += i + "," + i + "," + (i * (100-i) * 100/(50*50)) + "\n";
29 }
30 return ret;
285a6bda
DV
31 },
32 { }
d955e223
DV
33 );
34
35 google.load('visualization', '1', {packages: ['linechart']});
36 function addGViz() {
37 data = new google.visualization.DataTable();
38 data.addColumn('number', 'X');
39 data.addColumn('number', 'Y1');
40 data.addColumn('number', 'Y2');
41 data.addRows(100);
42 for (var i = 0; i < 100; i++) {
43 data.setCell(i, 0, i);
44 data.setCell(i, 1, i);
45 data.setCell(i, 2, i * (100-i) * 100/(50*50));
46 }
47
285a6bda 48 new Dygraph.GVizChart(
d955e223
DV
49 document.getElementById('gviz')).draw(data,
50 {
d955e223
DV
51 });
52 }
53
54 google.setOnLoadCallback(addGViz);
55 </script>
56 </body>
57</html>