Skip to content

Commit

Permalink
Merge 640c66d into 6611837
Browse files Browse the repository at this point in the history
  • Loading branch information
bgwines committed Apr 30, 2018
2 parents 6611837 + 640c66d commit 133f947
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/dygraph-tickers.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ export var numericLinearTicks = function(a, b, pixels, opts, dygraph, vals) {
return numericTicks(a, b, pixels, nonLogscaleOpts, dygraph, vals);
};

/** @type {Ticker} */
export var integerTicks = function(a, b, pixels, opts, dygraph, vals) {
var allTicks = numericTicks(a, b, pixels, opts, dygraph, vals);
return allTicks.filter(function(tick) {
return tick.v % 1 === 0;
});
};

/** @type {Ticker} */
export var numericTicks = function(a, b, pixels, opts, dygraph, vals) {
var pixels_per_tick = /** @type{number} */(opts('pixelsPerLabel'));
Expand Down Expand Up @@ -402,7 +410,7 @@ export var getDateAxis = function(start_time, end_time, granularity, opts, dg) {
// This will put the ticks on Sundays.
start_date_offset = accessors.getDay(start_date);
}

date_array[datefield] -= start_date_offset;
for (var df = datefield + 1; df < DateField.NUM_DATEFIELDS; df++) {
// The minimum value is 1 for the day of month, and 0 for all other fields.
Expand Down

0 comments on commit 133f947

Please sign in to comment.