Skip to content

Commit

Permalink
Stub fix for updating regions, w.r.t. issue bcbcarl#18
Browse files Browse the repository at this point in the history
  • Loading branch information
Nels Oscar authored and Nels Oscar committed Mar 20, 2017
1 parent 8a2b56b commit f44d7a5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ class C3Chart extends React.Component {
this.unloadData();
}

// If there are regions in the config, update them.
// If there are regions, and the config specifies none then delete the existing regions.
if (config.regions) {
this.chart.regions(config.regions);
} else if (this.chart.regions && !config.regions){
this.chart.regions([]);
}

this.loadNewData(config.data);
}

Expand Down

0 comments on commit f44d7a5

Please sign in to comment.