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

Method _generate

src/scales/scale.timeseries.js:119–130  ·  view source on GitHub ↗

* Generates all timestamps defined in the data. * Important: this method can return ticks outside the min and max range, it's the * responsibility of the calling code to clamp values if needed. * @protected

()

Source from the content-addressed store, hash-verified

117 * @protected
118 */
119 _generate() {
120 const min = this.min;
121 const max = this.max;
122 let timestamps = super.getDataTimestamps();
123 if (!timestamps.includes(min) || !timestamps.length) {
124 timestamps.splice(0, 0, min);
125 }
126 if (!timestamps.includes(max) || timestamps.length === 1) {
127 timestamps.push(max);
128 }
129 return timestamps.sort((a, b) => a - b);
130 }
131
132 /**
133 * Returns all timestamps

Callers

nothing calls this directly

Calls 1

getDataTimestampsMethod · 0.65

Tested by

no test coverage detected