Bug 284. Check that user_attrs_ and attrs_ !== null and remove mouse event handler...
[dygraphs.git] / tests / gviz-infinity.html
CommitLineData
54425b14 1<!DOCTYPE html>
1f7f664b
DV
2<html>
3 <head>
10494b48 4 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
1f7f664b
DV
5 <title>gviz</title>
6 <!--[if IE]>
7 <script type="text/javascript" src="../excanvas.js"></script>
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
1f7f664b
DV
15 <script type="text/javascript" src="http://www.google.com/jsapi"></script>
16 <script type="text/javascript">
17 google.load('visualization', '1', {packages: ['linechart']});
18
19 function createDataTable(dateType) {
20 data = new google.visualization.DataTable();
21 data.addColumn(dateType, 'Date');
22 data.addColumn('number', 'Column A');
23 data.addColumn('number', 'Column B');
24 data.addRows(4);
25 data.setCell(0, 0, new Date("2009/07/01"));
26 data.setCell(0, 1, 1);
27 data.setCell(0, 2, 7);
28 data.setCell(1, 0, new Date("2009/07/08"));
29 data.setCell(1, 1, 2);
30 data.setCell(1, 2, 4);
31 data.setCell(2, 0, new Date("2009/07/15"));
32 data.setCell(2, 1, 3);
33 data.setCell(2, 2, Infinity);
34 data.setCell(3, 0, new Date("2009/07/22"));
35 data.setCell(3, 1, 4);
36 data.setCell(3, 2, 0);
37 return data;
38 }
39
40 function drawVisualization() {
41 data = createDataTable('date');
42 new google.visualization.LineChart(
43 document.getElementById('gviz')).draw(data, null);
44
f6fbf9e0 45 var chart1 = new Dygraph.GVizChart(document.getElementById('dygraphs'))
1f7f664b
DV
46 .draw(data, { });
47
48 data = createDataTable('datetime');
f6fbf9e0 49 var chart2 = new Dygraph.GVizChart(
1f7f664b
DV
50 document.getElementById('dygraphs_datetime')).draw(data, {
51 });
52 }
53
54 google.setOnLoadCallback(drawVisualization);
55 </script>
56 </head>
57 <body>
58 <p>This tests that infinite values don't break dygraphs.</p>
59 <p>gviz line chart:</p>
60 <div id="gviz" style="width:600px; height:300px;"></div>
61
62 <p>same data drawn using dygraphs:</p>
63 date column:
64 <div id="dygraphs" style="width:600px; height:300px;"></div>
65 </body>
66</html>