Commit | Line | Data |
---|---|---|
54425b14 | 1 | <!DOCTYPE html> |
e69c4d71 DV |
2 | <html> |
3 | <head> | |
4 | <title>out of order</title> | |
7e5ddc94 DV |
5 | <!-- |
6 | For production (minified) code, use: | |
7 | <script type="text/javascript" src="dygraph-combined.js"></script> | |
8 | --> | |
9 | <script type="text/javascript" src="../dygraph-dev.js"></script> | |
10 | ||
e69c4d71 DV |
11 | <script type="text/javascript" src="http://www.google.com/jsapi"></script> |
12 | <script type="text/javascript"> | |
300c5ff0 DV |
13 | // Capture warnings, since these are what we want in this test. |
14 | Dygraph.prototype.warn = function(msg) { | |
15 | console.log(msg); | |
16 | }; | |
17 | ||
e69c4d71 DV |
18 | google.load('visualization', '1'); |
19 | ||
20 | function createDataTable(dateType) { | |
21 | data = new google.visualization.DataTable(); | |
22 | data.addColumn(dateType, 'Date'); | |
23 | data.addColumn('number', 'Column A'); | |
24 | data.addColumn('number', 'Column B'); | |
25 | data.addRows(4); | |
26 | data.setCell(0, 0, new Date("2009/07/15")); | |
27 | data.setCell(0, 1, 3); | |
28 | data.setCell(0, 2, 3); | |
29 | data.setCell(1, 0, new Date("2009/07/22")); | |
30 | data.setCell(1, 1, 4); | |
31 | data.setCell(1, 2, 0); | |
32 | data.setCell(2, 0, new Date("2009/07/08")); | |
33 | data.setCell(2, 1, 2); | |
34 | data.setCell(2, 2, 4); | |
35 | data.setCell(3, 0, new Date("2009/07/01")); | |
36 | data.setCell(3, 1, 1); | |
37 | data.setCell(3, 2, 7); | |
38 | return data; | |
39 | } | |
40 | ||
41 | var csv = | |
42 | "Date,Column A,Column B\n" + | |
43 | "2009/07/15,3,3\n" + | |
44 | "2009/07/22,4,0\n" + | |
45 | "2009/07/08,2,4\n" + | |
46 | "2009/07/01,1,7\n"; | |
47 | ||
48 | function drawVisualization() { | |
49 | data = createDataTable('date'); | |
50 | ||
f6fbf9e0 | 51 | var chart = new Dygraph.GVizChart( |
e69c4d71 DV |
52 | document.getElementById('dygraphs_gviz')).draw(data, { |
53 | }); | |
54 | ||
f6fbf9e0 | 55 | var graph = new Dygraph(document.getElementById('dygraphs'), csv); |
e69c4d71 DV |
56 | |
57 | } | |
58 | google.setOnLoadCallback(drawVisualization); | |
59 | </script> | |
60 | </head> | |
61 | <body> | |
62 | <p>CSV data source out of order:</p> | |
63 | <div id="dygraphs" style="width:600px; height:300px;"></div> | |
64 | ||
65 | <p>gviz data source out of order:</p> | |
66 | <div id="dygraphs_gviz" style="width:600px; height:300px;"></div> | |
67 | </body> | |
68 | </html> |