3 <title>numeric axis
</title>
5 <script type=
"text/javascript" src=
"excanvas.js"></script>
7 <script type=
"text/javascript" src=
"../dygraph-combined.js"></script>
8 <script type=
"text/javascript" src=
"../dygraph.js"></script>
9 <script type=
"text/javascript" src=
"http://www.google.com/jsapi"></script>
12 <p>CSV data source:
</p>
13 <div id=
"g" style=
"width:600px; height:300px;"></div>
15 <p>GViz data source:
</p>
16 <div id=
"gviz" style=
"width:600px; height:300px;"></div>
18 <script type=
"text/javascript">
20 document.getElementById(
"g"),
22 var ret =
"X,Y1,Y2\n";
23 for (var i =
0; i <
100; i++) {
24 ret += i +
"," + i +
"," + (i * (
100-i) *
100/(
50*
50)) +
"\n";
29 xValueParser: function(x) { return parseFloat(x); },
30 xValueFormatter: function(x) { return x; },
31 xTicker: DateGraph.prototype.numericTicks
35 google.load('visualization', '
1', {packages: ['linechart']});
37 data = new google.visualization.DataTable();
38 data.addColumn('number', 'X');
39 data.addColumn('number', 'Y1');
40 data.addColumn('number', 'Y2');
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));
48 new DateGraph.GVizChart(
49 document.getElementById('gviz')).draw(data,
51 xValueParser: function(x) { return parseFloat(x); },
52 xValueFormatter: function(x) { return x; },
53 xTicker: DateGraph.prototype.numericTicks
57 google.setOnLoadCallback(addGViz);