Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #7 from Mindaugas-Jacionis/master
Browse files Browse the repository at this point in the history
adds showAreas prop - allows user to define if areas are shown
  • Loading branch information
caledhwa authored Oct 10, 2016
2 parents 68085b4 + 017b8fb commit a04b897
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,17 @@ export default class LineChart extends Component {
margin:options.margin
}

let showAreas = typeof(this.props.options.showAreas) != 'undefined' ? this.props.options.showAreas : true;
let lines = _.map(chart.curves, function (c, i) {
return <Path key={'lines' + i} d={ c.line.path.print() } stroke={ this.color(i) } fill="none"/>
}.bind(this))
let areas = _.map(chart.curves, function (c, i) {
return <Path key={'areas' + i} d={ c.area.path.print() } fillOpacity={0.5} stroke="none" fill={ this.color(i) }/>
}.bind(this))
let areas = null;

if(showAreas){
areas = _.map(chart.curves, function (c, i) {
return <Path key={'areas' + i} d={ c.area.path.print() } fillOpacity={0.5} stroke="none" fill={ this.color(i) }/>
}.bind(this))
}

let offset = {
x: chartArea.margin.left * -1,
Expand Down

0 comments on commit a04b897

Please sign in to comment.