* Main entry point function for adding bar labels * @param barGroups - D3 selection for all bar groups * @param bandWidth - Bandwidth of the x or y axis * @param dom - X or y axis (depending on oridnetation) * @param rang - X or y axis (depending on orientation)
(
barGroups: any,
bandWidth: number,
dom: string,
rang: string
)
| 516 | * @param rang - X or y axis (depending on orientation) |
| 517 | */ |
| 518 | private manageBarLabels( |
| 519 | barGroups: any, |
| 520 | bandWidth: number, |
| 521 | dom: string, |
| 522 | rang: string |
| 523 | ): void { |
| 524 | if (!this.model.get('label_display')) { |
| 525 | return; |
| 526 | } |
| 527 | |
| 528 | // Ladding the labels |
| 529 | if (this.model.get('type') === 'stacked') { |
| 530 | this.stackedBarLabels(barGroups, bandWidth, dom, rang); |
| 531 | } else { |
| 532 | this.groupedBarLabels(barGroups, bandWidth); |
| 533 | } |
| 534 | |
| 535 | // Styling the labels |
| 536 | this.updateBarLabelsStyle(); |
| 537 | } |
| 538 | |
| 539 | /** |
| 540 | * All bars are stacked by default. The only other value this parameter can take is 'grouped' |
no test coverage detected