Skip to content

Commit

Permalink
Allow the .options() method to take an array of arguments. Fixes #769
Browse files Browse the repository at this point in the history
  • Loading branch information
ruhley authored and gordonwoodhull committed May 25, 2015
1 parent 307124a commit 50a5d96
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/base-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1073,9 +1073,25 @@ dc.baseMixin = function (_chart) {
```
**/
_chart.options = function (opts) {
var applyOptions = [
'anchor',
'group',
'xAxisLabel',
'yAxisLabel',
'stack',
'title',
'point',
'getColor',
'overlayGeoJson'
];

for (var o in opts) {
if (typeof(_chart[o]) === 'function') {
_chart[o].call(_chart, opts[o]);
if (opts[o] instanceof Array && applyOptions.indexOf(o) !== -1) {
_chart[o].apply(_chart, opts[o]);
} else {
_chart[o].call(_chart, opts[o]);
}
} else {
dc.logger.debug('Not a valid option setter name: ' + o);
}
Expand Down

0 comments on commit 50a5d96

Please sign in to comment.