(bars: BarElement[], start: number, count: number, mode: UpdateMode)
| 506 | } |
| 507 | |
| 508 | override updateElements(bars: BarElement[], start: number, count: number, mode: UpdateMode): void { |
| 509 | const reset = mode === 'reset'; |
| 510 | const {index, _cachedMeta: {vScale}} = this; |
| 511 | const base = vScale.getBasePixel(); |
| 512 | const horizontal = vScale.isHorizontal(); |
| 513 | const ruler = this._getRuler(); |
| 514 | const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode); |
| 515 | |
| 516 | for (let i = start; i < start + count; i++) { |
| 517 | const parsed: BarParsed = this.getParsed(i); |
| 518 | const vpixels: {base: number; head: number; size?: number} = reset || isNullOrUndef(parsed[vScale.axis]) ? {base, head: base} : this._calculateBarValuePixels(i); |
| 519 | const ipixels = this._calculateBarIndexPixels(i, ruler); |
| 520 | const stack = (parsed._stacks || {})[vScale.axis]; |
| 521 | |
| 522 | const properties: BarProperties = { |
| 523 | horizontal, |
| 524 | base: vpixels.base, |
| 525 | enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index === stack._top || index === stack._bottom), |
| 526 | x: horizontal ? vpixels.head : ipixels.center, |
| 527 | y: horizontal ? ipixels.center : vpixels.head, |
| 528 | height: horizontal ? ipixels.size : Math.abs(vpixels.size), |
| 529 | width: horizontal ? Math.abs(vpixels.size) : ipixels.size |
| 530 | }; |
| 531 | |
| 532 | if (includeOptions) { |
| 533 | properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode); |
| 534 | } |
| 535 | const options = properties.options || bars[i].options; |
| 536 | setBorderSkipped(properties, options, stack, index); |
| 537 | setInflateAmount(properties, options, ruler.ratio); |
| 538 | this.updateElement(bars[i], i, properties, mode); |
| 539 | } |
| 540 | } |
| 541 | |
| 542 | /** |
| 543 | * Returns the stacks based on groups and bar visibility. |
no test coverage detected