From 4ec7b44ab0077ff680be00577aa5b0c4317f2021 Mon Sep 17 00:00:00 2001 From: Mitch Foley Date: Fri, 15 Feb 2013 15:08:43 -0500 Subject: [PATCH] Making dygraph-tickers.js slightly more independent. --- dygraph-tickers.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dygraph-tickers.js b/dygraph-tickers.js index 6ad3102..77f2f62 100644 --- a/dygraph-tickers.js +++ b/dygraph-tickers.js @@ -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; -- 2.7.4