Skip to content

Commit 5dc21db

Browse files
committed
Added valueLabels to axes
1 parent 81743b4 commit 5dc21db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Axes.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ var Axes = React.createClass({
6868
valueAxisMode: React.PropTypes.oneOf(['normal', 'inverted']),
6969
valueScale: ScalePropType.isRequired,
7070
valueLabelStyle: Text.propTypes.style,
71+
valueLabels: React.PropTypes.arrayOf(React.PropTypes.string),
7172

7273
// Style
7374
orientation: React.PropTypes.oneOf(['vertical', 'horizontal']),
@@ -436,7 +437,7 @@ var Axes = React.createClass({
436437
this.xAxisMode = this.props.categoryAxisMode;
437438
this.yAxisMode = 'point';
438439
this.xAxisLabels = this.props.categoryLabels;
439-
this.yAxisLabels = fixedValues.reverse();
440+
this.yAxisLabels = this.props.valueLabels || fixedValues.reverse();
440441
this.xAxisUnits = this._getCategoryUnits(props);
441442
this.yAxisUnits = this._getValueUnits(props).reverse();
442443
} else {
@@ -455,7 +456,7 @@ var Axes = React.createClass({
455456
this.yAxisMode = this.props.categoryAxisMode;
456457
this.xAxisMode = 'point';
457458
this.yAxisLabels = this.props.categoryLabels;
458-
this.xAxisLabels = fixedValues;
459+
this.xAxisLabels = this.props.valueLabels || fixedValues;
459460
this.yAxisUnits = this._getCategoryUnits(props);
460461
this.xAxisUnits = this._getValueUnits(props);
461462
}

0 commit comments

Comments
 (0)