-// Copyright 2011 Dan Vanderkam (danvdk@gmail.com)
-// All Rights Reserved.
+/**
+ * @license
+ * Copyright 2011 Dan Vanderkam (danvdk@gmail.com)
+ * MIT-licensed (http://opensource.org/licenses/MIT)
+ */
/**
* @fileoverview A wrapper around the Dygraph class which implements the
* - http://dygraphs.com/tests/annotation-gviz.html
*/
+/*jshint globalstrict: true */
+/*global Dygraph:false */
+"use strict";
+
/**
* A wrapper around Dygraph that implements the gviz API.
* @param {Object} container The DOM object the visualization should live in.
*/
Dygraph.GVizChart = function(container) {
this.container = container;
-}
+};
Dygraph.GVizChart.prototype.draw = function(data, options) {
// Clear out any existing dygraph.
}
this.date_graph = new Dygraph(this.container, data, options);
-}
+};
/**
* Google charts compatible setSelection
row = selection_array[0].row;
}
this.date_graph.setSelection(row);
-}
+};
/**
* Google charts compatible getSelection implementation
if (row < 0) return selection;
- col = 1;
- for (var i in this.date_graph.layout_.datasets) {
+ var col = 1;
+ var datasets = this.date_graph.layout_.datasets;
+ for (var k in datasets) {
+ if (!datasets.hasOwnProperty(k)) continue;
selection.push({row: row, column: col});
col++;
}
return selection;
-}
+};