MCPcopy Index your code
hub / github.com/bqplot/bqplot / updateBarLabelsStyle

Method updateBarLabelsStyle

js/src/Bars.ts:680–693  ·  view source on GitHub ↗

* Adds CSS styling to the bar labels

()

Source from the content-addressed store, hash-verified

678 * Adds CSS styling to the bar labels
679 */
680 private updateBarLabelsStyle(): void {
681 const displayFormatStr = this.model.get('label_display_format');
682 const displayFormat = displayFormatStr ? d3.format(displayFormatStr) : null;
683
684 let fonts = this.d3el
685 .selectAll('.bar_label')
686 .text((d: any, i) => (displayFormat ? displayFormat(d.y) : null));
687
688 const fontStyle = this.model.get('label_font_style');
689
690 for (const styleKey in fontStyle) {
691 fonts = fonts.style(styleKey, fontStyle[styleKey]);
692 }
693 }
694
695 private updateType() {
696 // We need to update domains here as the y_domain needs to be

Callers 1

manageBarLabelsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected