Remove gadget links from tutorial (#780)
[dygraphs.git] / tests / gviz-infinity.html
... / ...
CommitLineData
1<!DOCTYPE html>
2<html>
3 <head>
4 <link rel="stylesheet" href="../css/dygraph.css">
5 <title>gviz</title>
6 <!--
7 For production (minified) code, use:
8 <script type="text/javascript" src="dygraph-combined.js"></script>
9 -->
10 <script type="text/javascript" src="../dist/dygraph.js"></script>
11
12 <script type="text/javascript" src="http://www.google.com/jsapi"></script>
13 <script type="text/javascript">
14 google.load('visualization', '1', {packages: ['linechart']});
15
16 function createDataTable(dateType) {
17 data = new google.visualization.DataTable();
18 data.addColumn(dateType, 'Date');
19 data.addColumn('number', 'Column A');
20 data.addColumn('number', 'Column B');
21 data.addRows(4);
22 data.setCell(0, 0, new Date("2009/07/01"));
23 data.setCell(0, 1, 1);
24 data.setCell(0, 2, 7);
25 data.setCell(1, 0, new Date("2009/07/08"));
26 data.setCell(1, 1, 2);
27 data.setCell(1, 2, 4);
28 data.setCell(2, 0, new Date("2009/07/15"));
29 data.setCell(2, 1, 3);
30 data.setCell(2, 2, Infinity);
31 data.setCell(3, 0, new Date("2009/07/22"));
32 data.setCell(3, 1, 4);
33 data.setCell(3, 2, 0);
34 return data;
35 }
36
37 function drawVisualization() {
38 data = createDataTable('date');
39 new google.visualization.LineChart(
40 document.getElementById('gviz')).draw(data, null);
41
42 var chart1 = new Dygraph.GVizChart(document.getElementById('dygraphs'))
43 .draw(data, { });
44 }
45
46 google.setOnLoadCallback(drawVisualization);
47 </script>
48 </head>
49 <body>
50 <p>This tests that infinite values don't break dygraphs.</p>
51 <p>gviz line chart:</p>
52 <div id="gviz" style="width:600px; height:300px;"></div>
53
54 <p>same data drawn using dygraphs:</p>
55 date column:
56 <div id="dygraphs" style="width:600px; height:300px;"></div>
57 </body>
58</html>