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

Function parseFloatBar

src/controllers/controller.bar.js:117–142  ·  src/controllers/controller.bar.js::parseFloatBar
(entry, item, vScale, i)

Source from the content-addressed store, hash-verified

115}
116
117function parseFloatBar(entry, item, vScale, i) {
118 const startValue = vScale.parse(entry[0], i);
119 const endValue = vScale.parse(entry[1], i);
120 const min = Math.min(startValue, endValue);
121 const max = Math.max(startValue, endValue);
122 let barStart = min;
123 let barEnd = max;
124
125 if (Math.abs(min) > Math.abs(max)) {
126 barStart = max;
127 barEnd = min;
128 }
129
130 class="cm">// Store `barEnd` (furthest away from origin) as parsed value,
131 class="cm">// to make stacking straight forward
132 item[vScale.axis] = barEnd;
133
134 item._custom = {
135 barStart,
136 barEnd,
137 start: startValue,
138 end: endValue,
139 min,
140 max
141 };
142}
143
144function parseValue(entry, item, vScale, i) {
145 if (isArray(entry)) {

Callers 1

parseValueFunction · 0.85

Calls 1

parseMethod · 0.65

Tested by

no test coverage detected