Skip to content

Commit

Permalink
feat(chart): allow preserveAspectRatio prop for bar chart
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmeinke committed Mar 12, 2016
1 parent 6ec5e8d commit 07f068b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/BarChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const BarChart = createClass({
chartClassName: PropTypes.string,
easing: PropTypes.oneOfType([ PropTypes.func, PropTypes.string ]),
height: PropTypes.number,
preserveAspectRatio: PropTypes.string,
spacing: PropTypes.number,
width: PropTypes.number,
},
Expand All @@ -17,6 +18,7 @@ const BarChart = createClass({
duration: 750,
easing: 'easeOutBounce',
height: 500,
preserveAspectRatio: 'xMidYMid meet',
spacing: 10,
width: 800,
};
Expand Down Expand Up @@ -45,6 +47,7 @@ const BarChart = createClass({
<svg
className={ this.props.chartClassName }
height={ this.props.height }
preserveAspectRatio={ this.props.preserveAspectRatio }
width={ this.props.width }
viewBox={ `0 0 ${ this.props.width } ${ this.props.height }` }
>
Expand Down

0 comments on commit 07f068b

Please sign in to comment.