corrected number of months in a QUARTERLY granularity
[dygraphs.git] / dygraph-tickers.js
index 4909909..b30b5a8 100644 (file)
@@ -314,7 +314,7 @@ Dygraph.numDateTicks = function(start_time, end_time, granularity) {
   } else {
     var year_mod = 1;  // e.g. to only print one point every 10 years.
     var num_months = 12;
-    if (granularity == Dygraph.QUARTERLY) num_months = 3;
+    if (granularity == Dygraph.QUARTERLY) num_months = 4;
     if (granularity == Dygraph.BIANNUAL) num_months = 2;
     if (granularity == Dygraph.ANNUAL) num_months = 1;
     if (granularity == Dygraph.DECADAL) { num_months = 1; year_mod = 10; }
@@ -386,7 +386,7 @@ Dygraph.getDateAxis = function(start_time, end_time, granularity, opts, dg) {
     var check_dst = (spacing >= Dygraph.SHORT_SPACINGS[Dygraph.TWO_HOURLY]);
 
     for (t = start_time; t <= end_time; t += spacing) {
-      var d = new Date(t);
+      d = new Date(t);
 
       // This ensures that we stay on the same hourly "rhythm" across
       // daylight savings transitions. Without this, the ticks could get off