* @return {object[]}
()
| 366 | * @return {object[]} |
| 367 | */ |
| 368 | buildTicks() { |
| 369 | const options = this.options; |
| 370 | const timeOpts = options.time; |
| 371 | const tickOpts = options.ticks; |
| 372 | const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate(); |
| 373 | |
| 374 | if (options.bounds === 'ticks' && timestamps.length) { |
| 375 | this.min = this._userMin || timestamps[0]; |
| 376 | this.max = this._userMax || timestamps[timestamps.length - 1]; |
| 377 | } |
| 378 | |
| 379 | const min = this.min; |
| 380 | const max = this.max; |
| 381 | |
| 382 | const ticks = _filterBetween(timestamps, min, max); |
| 383 | |
| 384 | // PRIVATE |
| 385 | // determineUnitForFormatting relies on the number of ticks so we don't use it when |
| 386 | // autoSkip is enabled because we don't yet know what the final number of ticks will be |
| 387 | this._unit = timeOpts.unit || (tickOpts.autoSkip |
| 388 | ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) |
| 389 | : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max)); |
| 390 | this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined |
| 391 | : determineMajorUnit(this._unit); |
| 392 | this.initOffsets(timestamps); |
| 393 | |
| 394 | if (options.reverse) { |
| 395 | ticks.reverse(); |
| 396 | } |
| 397 | |
| 398 | return ticksFromTimestamps(this, ticks, this._majorUnit); |
| 399 | } |
| 400 | |
| 401 | afterAutoSkip() { |
| 402 | // Offsets for bar charts need to be handled with the auto skipped |
nothing calls this directly
no test coverage detected