(stack, value, dsIndex, options = {})
| 68 | } |
| 69 | |
| 70 | function applyStack(stack, value, dsIndex, options = {}) { |
| 71 | const keys = stack.keys; |
| 72 | const singleMode = options.mode === class="st">'single'; |
| 73 | let i, ilen, datasetIndex, otherValue; |
| 74 | |
| 75 | if (value === null) { |
| 76 | return; |
| 77 | } |
| 78 | |
| 79 | let found = false; |
| 80 | for (i = 0, ilen = keys.length; i < ilen; ++i) { |
| 81 | datasetIndex = +keys[i]; |
| 82 | if (datasetIndex === dsIndex) { |
| 83 | found = true; |
| 84 | if (options.all) { |
| 85 | continue; |
| 86 | } |
| 87 | break; |
| 88 | } |
| 89 | otherValue = stack.values[datasetIndex]; |
| 90 | if (isFinite(otherValue) && (singleMode || (value === 0 || sign(value) === sign(otherValue)))) { |
| 91 | value += otherValue; |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | if (!found && !options.all) { |
| 96 | return 0; |
| 97 | } |
| 98 | |
| 99 | return value; |
| 100 | } |
| 101 | |
| 102 | function convertObjectDataToArray(data, meta) { |
| 103 | const {iScale, vScale} = meta; |
no outgoing calls
no test coverage detected