helpers.each(this.chart.data.datasets, function(dataset, datasetIndex) {
var momentsForDataset = [];
+ var datasetVisible = helpers.isDatasetVisible(dataset);
if (typeof dataset.data[0] === 'object') {
helpers.each(dataset.data, function(value, index) {
}
momentsForDataset.push(labelMoment);
- // May have gone outside the scale ranges, make sure we keep the first and last ticks updated
- this.firstTick = this.firstTick !== null ? moment.min(this.firstTick, labelMoment) : labelMoment;
- this.lastTick = this.lastTick !== null ? moment.max(this.lastTick, labelMoment) : labelMoment;
+ if (datasetVisible) {
+ // May have gone outside the scale ranges, make sure we keep the first and last ticks updated
+ this.firstTick = this.firstTick !== null ? moment.min(this.firstTick, labelMoment) : labelMoment;
+ this.lastTick = this.lastTick !== null ? moment.max(this.lastTick, labelMoment) : labelMoment;
+ }
}
}, this);
} else {