Make text area size configurable in pixels.
[dygraphs.git] / gallery / annotation-gviz.js
1 Gallery.register(
2 'annotation-gviz',
3 {
4 name: 'Annotation Gviz (broken)',
5 title: 'Comparison of Gviz and Dygraphs annotated timelines',
6 setup : function(parent) {
7 parent.innerHTML =
8 "<h3>Google AnnotatedTimeline:</h3>" +
9 "<div id='gviz_div' style='width: 700px; height: 240px;'></div>" +
10 "<h3>Dygraph.GVizChart:</h3>" +
11 "<div id='dg_div' style='width: 700px; height: 240px;'></div>";
12 },
13 run: function() {
14 drawChart = function() {
15 var data = new google.visualization.DataTable();
16 data.addColumn('date', 'Date');
17 data.addColumn('number', 'Sold Pencils');
18 data.addColumn('string', 'title1');
19 data.addColumn('string', 'text1');
20 data.addColumn('number', 'Sold Pens');
21 data.addColumn('string', 'title2');
22 data.addColumn('string', 'text2');
23 data.addRows([
24 [new Date(2008, 1 ,1), 30000, undefined, undefined, 40645, undefined, undefined],
25 [new Date(2008, 1 ,2), 14045, undefined, undefined, 20374, undefined, undefined],
26 [new Date(2008, 1 ,3), 55022, undefined, undefined, 50766, undefined, undefined],
27 [new Date(2008, 1 ,4), 75284, undefined, undefined, 14334, 'Out of Stock','Ran out of stock on pens at 4pm'],
28 [new Date(2008, 1 ,5), 41476, 'Bought Pens','Bought 200k pens', 66467, undefined, undefined],
29 [new Date(2008, 1 ,6), 33322, undefined, undefined, 39463, undefined, undefined]
30 ]);
31
32 var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('gviz_div'));
33 chart.draw(data, {displayAnnotations: true});
34
35 };
36 google.setOnLoadCallback(drawChart);
37 var f = function() { alert("!"); };
38 google.setOnLoadCallback(f);
39 var g = new Dygraph.GVizChart(document.getElementById("dg_div"));
40 g.draw(data, {displayAnnotations: true, labelsKMB: true});
41 }
42 });