Skip to content

Commit

Permalink
Label color can be specified for BarChartNOde, see #49
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Apr 30, 2020
1 parent 36874cf commit 0014453
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/BarChartNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import griddle from './griddle.js';
* {
* entries: {Array.<{ property: {Property.<number>}, color: {paint} }>}
* [labelString]: {string} formatted for RichText
* [labelColor]: {PaintDef} if provided, sets color of the bar label, otherwise label match color of bar
* [labelNode]: {node} displayed below the label string if the label string exist
* [offScaleArrowFill]: {paint} - If provided, allows bar-specific arrow fills (that are different than the color)
* }
Expand Down Expand Up @@ -101,7 +102,7 @@ function BarChartNode( bars, rangeProperty, options ) {
if ( bar.labelString ) {

const labelText = new RichText( bar.labelString, merge( {}, options.barLabelOptions, {
fill: bar.entries.length === 1 ? bar.entries[ 0 ].color : 'black'
fill: bar.labelColor || 'black'
} ) );

// Transparent background for each label, used to make the label standout against bar if the bar falls beneath the x-Axis.
Expand Down

0 comments on commit 0014453

Please sign in to comment.