MCPcopy
hub / github.com/chartjs/Chart.js / addTick

Function addTick

src/scales/scale.time.js:139–147  ·  view source on GitHub ↗

* @param {object} ticks * @param {number} time * @param {number[]} [timestamps] - if defined, snap to these timestamps

(ticks, time, timestamps)

Source from the content-addressed store, hash-verified

137 * @param {number[]} [timestamps] - if defined, snap to these timestamps
138 */
139function addTick(ticks, time, timestamps) {
140 if (!timestamps) {
141 ticks[time] = true;
142 } else if (timestamps.length) {
143 const {lo, hi} = _lookup(timestamps, time);
144 const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];
145 ticks[timestamp] = true;
146 }
147}
148
149/**
150 * @param {TimeScale} scale

Callers 1

_generateMethod · 0.85

Calls 1

_lookupFunction · 0.85

Tested by

no test coverage detected