* Resolves `base` for one bar. An array or a function gives each bar its own base, * resolved with the bar's context. Any other value is shared by all bars and kept * until the next `configure()`. * @internal
(index: number)
| 689 | * @internal |
| 690 | */ |
| 691 | _resolveBase(index: number): number | undefined { |
| 692 | const cache = this._cachedDataOpts as {$base?: {base: number | undefined}}; |
| 693 | if (cache.$base) { |
| 694 | return cache.$base.base; |
| 695 | } |
| 696 | const config = this.chart.config; |
| 697 | const scopes = config.getOptionScopes(this.getDataset(), config.datasetScopeKeys(this._type)); |
| 698 | const values = config.resolveNamedOptions(scopes, ['base'], () => this.getContext(index)); |
| 699 | if (values.$shared) { |
| 700 | cache.$base = values; |
| 701 | } |
| 702 | return values.base; |
| 703 | } |
| 704 | |
| 705 | /** |
| 706 | * Note: pixel values are not clamped to the scale area. |
no test coverage detected