$('#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')
);
// 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)
);
}
} 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)