X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=d9997e9d334b68fa3346efd604374e96ce1be636;hb=9fa43d8fc3b517a6bdeddbb1dd77d26c6423eefe;hp=743219ca8ebd9736f2e7d22d379f173593695c80;hpb=b1a3b195f92497b7dd659171af60fa46c93c50c2;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index 743219c..d9997e9 100644 --- a/dygraph.js +++ b/dygraph.js @@ -43,6 +43,8 @@ */ +"use strict"; + /** * Creates an interactive, zoomable chart. * @@ -57,7 +59,7 @@ * whether the input data contains error ranges. For a complete list of * options, see http://dygraphs.com/options.html. */ -Dygraph = function(div, data, opts) { +var Dygraph = function(div, data, opts) { if (arguments.length > 0) { if (arguments.length == 4) { // Old versions of dygraphs took in the series labels as a constructor @@ -812,14 +814,6 @@ Dygraph.prototype.createInterface_ = function() { this.rangeSelector_.addToGraph(this.graphDiv, this.layout_); } - // Create the grapher - this.layout_ = new DygraphLayout(this); - - if (this.rangeSelector_) { - // This needs to happen after the graph canvases are added to the div and the layout object is created. - this.rangeSelector_.addToGraph(this.graphDiv, this.layout_); - } - var dygraph = this; Dygraph.addEvent(this.mouseEventElement_, 'mousemove', function(e) { dygraph.mouseMove_(e); @@ -1937,8 +1931,10 @@ Dygraph.prototype.gatherDatasets_ = function(rolledSeries, dateWindow) { if (bars) { for (var j=0; j 0 || + var dashPos = str.indexOf('-'); // could be 2006-01-01 _or_ 1.0e-2 + if ((dashPos > 0 && (str[dashPos-1] != 'e' && str[dashPos-1] != 'E')) || str.indexOf('/') >= 0 || isNaN(parseFloat(str))) { isDate = true; @@ -3201,4 +3198,4 @@ Dygraph.addAnnotationRule = function() { } // Older pages may still use this name. -DateGraph = Dygraph; +var DateGraph = Dygraph;