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

Function parseArrayOrPrimitive

src/controllers/controller.bar.js:153–168  ·  src/controllers/controller.bar.js::parseArrayOrPrimitive
(meta, data, start, count)

Source from the content-addressed store, hash-verified

151}
152
153function parseArrayOrPrimitive(meta, data, start, count) {
154 const iScale = meta.iScale;
155 const vScale = meta.vScale;
156 const labels = iScale.getLabels();
157 const singleScale = iScale === vScale;
158 const parsed = [];
159 let i, ilen, item, entry;
160
161 for (i = start, ilen = start + count; i < ilen; ++i) {
162 entry = data[i];
163 item = {};
164 item[iScale.axis] = singleScale || iScale.parse(labels[i], i);
165 parsed.push(parseValue(entry, item, vScale, i));
166 }
167 return parsed;
168}
169
170function isFloatBar(custom) {
171 return custom && custom.barStart !== undefined && custom.barEnd !== undefined;

Callers 2

parsePrimitiveDataMethod · 0.85
parseArrayDataMethod · 0.85

Calls 3

parseValueFunction · 0.85
getLabelsMethod · 0.65
parseMethod · 0.65

Tested by

no test coverage detected