diff --git a/src/scales/scale.time.js b/src/scales/scale.time.js index d768298343a..087f847691b 100644 --- a/src/scales/scale.time.js +++ b/src/scales/scale.time.js @@ -341,9 +341,13 @@ function computeOffsets(table, ts, min, max, options) { var i, ilen, timestamp, length, upper, lower, divisor; if (options.offset) { + // First, it processes `ts.labels` to pick up timestamps of labels, which are + // primarily used for offset calculation because bars are usually on labels. + // But if there are no labels, it should add offsets based on `ts.data` because + // we support bars with {t, y} data points as well. That is the second path. [ts.labels, ts.data].forEach(function(data) { if (!timestamps.length) { - // Remove labels outside the min/max range + // Remove timestamps outside the min/max range for (i = 0, ilen = data.length; i < ilen; ++i) { timestamp = data[i]; if (timestamp >= min && timestamp <= max) {