Time scale now draws all ticks, instead of half of them

Closes #1463
This commit is contained in:
Tanner Linsley 2015-09-21 11:52:17 -06:00
parent 848710b447
commit 2a76ff0037
2 changed files with 3 additions and 5 deletions

View File

@ -152,9 +152,7 @@
$('#addData').click(function() {
if (config.data.datasets.length > 0) {
config.data.labels.push(
moment(
config.data.labels[config.data.labels.length - 1], config.options.scales.xAxes[0].time.format
).add(1, 'day')
myLine.scales['x-axis-0'].labelMoments[myLine.scales['x-axis-0'].labelMoments.length - 1].add(1, 'day')
.format('MM/DD/YYYY')
);

View File

@ -176,7 +176,7 @@
// For every unit in between the first and last moment, create a moment and add it to the labels tick
if (this.options.labels.userCallback) {
for (; i <= this.tickRange; i++) {
for (i = 0; i <= this.tickRange; i++) {
this.ticks.push(
this.options.labels.userCallback(this.firstTick.clone()
.add(i, this.tickUnit)
@ -185,7 +185,7 @@
);
}
} else {
for (; i <= this.tickRange; i++) {
for (i = 0; i <= this.tickRange; i++) {
this.ticks.push(this.firstTick.clone()
.add(i, this.tickUnit)
.format(this.options.tick.displayFormat ? this.options.tick.displayFormat : time.unit[this.tickUnit].display)