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

Method _getTimestampsForTable

src/scales/scale.timeseries.js:137–156  ·  view source on GitHub ↗

* Returns all timestamps * @return {number[]} * @private

()

Source from the content-addressed store, hash-verified

135 * @private
136 */
137 _getTimestampsForTable() {
138 let timestamps = this._cache.all || [];
139
140 if (timestamps.length) {
141 return timestamps;
142 }
143
144 const data = this.getDataTimestamps();
145 const label = this.getLabelTimestamps();
146 if (data.length && label.length) {
147 // If combining labels and data (data might not contain all labels),
148 // we need to recheck uniqueness and sort
149 timestamps = this.normalize(data.concat(label));
150 } else {
151 timestamps = data.length ? data : label;
152 }
153 timestamps = this._cache.all = timestamps;
154
155 return timestamps;
156 }
157
158 /**
159 * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)

Callers 1

initOffsetsMethod · 0.95

Calls 3

getDataTimestampsMethod · 0.65
getLabelTimestampsMethod · 0.65
normalizeMethod · 0.65

Tested by

no test coverage detected