Browse Source

Fix interface of toggle API - #776

pull/785/head
Masayuki Tanaka 10 years ago
parent
commit
7148dea72b
  1. 8
      c3.js
  2. 4
      c3.min.js
  3. 8
      src/api.show.js

8
c3.js

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

4
c3.min.js vendored

File diff suppressed because one or more lines are too long

8
src/api.show.js

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

Loading…
Cancel
Save