Browse Source

Accept string and array in unload API

pull/631/head
Masayuki Tanaka 10 years ago
parent
commit
b64efaf917
  1. 5
      c3.js
  2. 2
      c3.min.js
  3. 5
      src/api.load.js

5
c3.js

@ -5564,6 +5564,11 @@
c3_chart_fn.unload = function (args) {
var $$ = this.internal;
args = args || {};
if (args instanceof Array) {
args = {ids: args};
} else if (typeof args === 'string') {
args = {ids: [args]};
}
$$.unload($$.mapToTargetIds(args.ids), function () {
$$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
if (args.done) { args.done(); }

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

5
src/api.load.js

@ -33,6 +33,11 @@ c3_chart_fn.load = function (args) {
c3_chart_fn.unload = function (args) {
var $$ = this.internal;
args = args || {};
if (args instanceof Array) {
args = {ids: args};
} else if (typeof args === 'string') {
args = {ids: [args]};
}
$$.unload($$.mapToTargetIds(args.ids), function () {
$$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
if (args.done) { args.done(); }

Loading…
Cancel
Save