Browse Source

Fix toggle to accept options

pull/851/head
Masayuki Tanaka 10 years ago
parent
commit
c7dfed6f02
  1. 4
      c3.js
  2. 2
      c3.min.js
  3. 4
      src/api.show.js

4
c3.js

@ -5789,10 +5789,10 @@
$$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
};
c3_chart_fn.toggle = function (targetIds) {
c3_chart_fn.toggle = function (targetIds, options) {
var that = this, $$ = this.internal;
$$.mapToTargetIds(targetIds).forEach(function (targetId) {
$$.isTargetToShow(targetId) ? that.hide(targetId) : that.show(targetId);
$$.isTargetToShow(targetId) ? that.hide(targetId, options) : that.show(targetId, options);
});
};

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

4
src/api.show.js

@ -42,9 +42,9 @@ c3_chart_fn.hide = function (targetIds, options) {
$$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
};
c3_chart_fn.toggle = function (targetIds) {
c3_chart_fn.toggle = function (targetIds, options) {
var that = this, $$ = this.internal;
$$.mapToTargetIds(targetIds).forEach(function (targetId) {
$$.isTargetToShow(targetId) ? that.hide(targetId) : that.show(targetId);
$$.isTargetToShow(targetId) ? that.hide(targetId, options) : that.show(targetId, options);
});
};

Loading…
Cancel
Save