(bars, start, count, mode)
| 391 | } |
| 392 | |
| 393 | updateElements(bars, start, count, mode) { |
| 394 | const reset = mode === 'reset'; |
| 395 | const {index, _cachedMeta: {vScale}} = this; |
| 396 | const base = vScale.getBasePixel(); |
| 397 | const horizontal = vScale.isHorizontal(); |
| 398 | const ruler = this._getRuler(); |
| 399 | const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode); |
| 400 | |
| 401 | for (let i = start; i < start + count; i++) { |
| 402 | const parsed = this.getParsed(i); |
| 403 | const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {base, head: base} : this._calculateBarValuePixels(i); |
| 404 | const ipixels = this._calculateBarIndexPixels(i, ruler); |
| 405 | const stack = (parsed._stacks || {})[vScale.axis]; |
| 406 | |
| 407 | const properties = { |
| 408 | horizontal, |
| 409 | base: vpixels.base, |
| 410 | enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index === stack._top || index === stack._bottom), |
| 411 | x: horizontal ? vpixels.head : ipixels.center, |
| 412 | y: horizontal ? ipixels.center : vpixels.head, |
| 413 | height: horizontal ? ipixels.size : Math.abs(vpixels.size), |
| 414 | width: horizontal ? Math.abs(vpixels.size) : ipixels.size |
| 415 | }; |
| 416 | |
| 417 | if (includeOptions) { |
| 418 | properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode); |
| 419 | } |
| 420 | const options = properties.options || bars[i].options; |
| 421 | setBorderSkipped(properties, options, stack, index); |
| 422 | setInflateAmount(properties, options, ruler.ratio); |
| 423 | this.updateElement(bars[i], i, properties, mode); |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | /** |
| 428 | * Returns the stacks based on groups and bar visibility. |
no test coverage detected