Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
Add additional props to yAxis
Browse files Browse the repository at this point in the history
  • Loading branch information
esbullington committed Jan 22, 2015
1 parent 06265e4 commit 6e41ac1
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,21 @@ exports.YAxis = React.createClass({
propTypes: {
yAxisClassName: React.PropTypes.string,
orient: React.PropTypes.oneOf(['left', 'right']),
yScale: React.PropTypes.func.isRequired
yScale: React.PropTypes.func.isRequired,
fill: React.PropTypes.string,
stroke: React.PropTypes.string,
tickStroke: React.PropTypes.string,
strokeWidth: React.PropTypes.string
},

getDefaultProps: function() {
return {
yAxisClassName: 'y axis',
orient: 'left'
orient: 'left',
fill: "none",
stroke: "#000",
tickStroke: "#000",
strokeWidth: "none"
};
},

Expand Down Expand Up @@ -162,14 +170,14 @@ exports.YAxis = React.createClass({
d3.selectAll(yAxisClassSelect)
.selectAll('line')
.attr("shape-rendering", "crispEdges")
.attr("stroke", "#000");
.attr("stroke", props.tickStroke);

// Style the main axis line
d3.selectAll(yAxisClassSelect)
.select('path')
.attr("shape-rendering", "crispEdges")
.attr("fill", "none")
.attr("stroke", "#000")
.attr("fill", props.fill)
.attr("stroke", props.stroke)

},

Expand Down

0 comments on commit 6e41ac1

Please sign in to comment.