mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
parent
848710b447
commit
2a76ff0037
@ -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')
|
||||
);
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user