Making dygraph-tickers.js slightly more independent.
authorMitch Foley <mitch@thefoley.net>
Fri, 15 Feb 2013 20:08:43 +0000 (15:08 -0500)
committerMitch Foley <mitch@thefoley.net>
Fri, 15 Feb 2013 20:08:43 +0000 (15:08 -0500)
dygraph-tickers.js

index 6ad3102..77f2f62 100644 (file)
@@ -479,7 +479,13 @@ Dygraph.getDateAxis = function(start_time, end_time, granularity, opts, dg) {
   return ticks;
 };
 
-// These are set here so that this file can be included after dygraph.js.
+// These are set here so that this file can be included after dygraph.js
+// or independently.
+Dygraph.DEFAULT_ATTRS = Dygraph.DEFAULT_ATTRS || {};
+Dygraph.DEFAULT_ATTRS['axes'] = Dygraph.DEFAULT_ATTRS['axes'] || {};
+Dygraph.DEFAULT_ATTRS['axes']['x'] = Dygraph.DEFAULT_ATTRS['axes']['x'] || {};
+Dygraph.DEFAULT_ATTRS['axes']['y'] = Dygraph.DEFAULT_ATTRS['axes']['y'] || {};
+Dygraph.DEFAULT_ATTRS['axes']['y2'] = Dygraph.DEFAULT_ATTRS['axes']['y2'] || {};
 Dygraph.DEFAULT_ATTRS['axes']['x']['ticker'] = Dygraph.dateTicker;
 Dygraph.DEFAULT_ATTRS['axes']['y']['ticker'] = Dygraph.numericTicks;
 Dygraph.DEFAULT_ATTRS['axes']['y2']['ticker'] = Dygraph.numericTicks;