Skip to content

Commit 0050c1e

Browse files
committed
clearer docs on date histogram autobins
1 parent dcd4be1 commit 0050c1e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/plots/cartesian/axes.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,10 @@ axes.autoBin = function(data, ax, nbins, is2d) {
548548
}
549549
else {
550550
// month ticks - should be the only nonlinear kind we have at this point.
551+
// dtick (as supplied by axes.autoTick) only has nonlinear values on
552+
// date and log axes, but even if you display a histogram on a log axis
553+
// we bin it on a linear axis (which one could argue against, but that's
554+
// a separate issue)
551555
if(dummyAx.dtick.charAt(0) === 'M') {
552556
binStart = autoShiftMonthBins(binStart, data, dummyAx.dtick, dataMin);
553557
}

test/jasmine/tests/histogram2d_test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ describe('Test histogram2d', function() {
9292
// TODO: even though the binning is done on non-uniform bins,
9393
// the display makes them linear (using only y0 and dy)
9494
// Can we also make it display the bins with nonuniform size?
95+
// see https://github.com/plotly/plotly.js/issues/360
9596
expect(out.y0).toBe('1970-01-01 03:00');
9697
expect(out.dy).toBe(365.25 * oneDay);
9798

0 commit comments

Comments
 (0)