Commit b64efaf9 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Accept string and array in unload API

parent 152412f0
...@@ -5564,6 +5564,11 @@ ...@@ -5564,6 +5564,11 @@
c3_chart_fn.unload = function (args) { c3_chart_fn.unload = function (args) {
var $$ = this.internal; var $$ = this.internal;
args = args || {}; args = args || {};
if (args instanceof Array) {
args = {ids: args};
} else if (typeof args === 'string') {
args = {ids: [args]};
}
$$.unload($$.mapToTargetIds(args.ids), function () { $$.unload($$.mapToTargetIds(args.ids), function () {
$$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true}); $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
if (args.done) { args.done(); } if (args.done) { args.done(); }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -33,6 +33,11 @@ c3_chart_fn.load = function (args) { ...@@ -33,6 +33,11 @@ c3_chart_fn.load = function (args) {
c3_chart_fn.unload = function (args) { c3_chart_fn.unload = function (args) {
var $$ = this.internal; var $$ = this.internal;
args = args || {}; args = args || {};
if (args instanceof Array) {
args = {ids: args};
} else if (typeof args === 'string') {
args = {ids: [args]};
}
$$.unload($$.mapToTargetIds(args.ids), function () { $$.unload($$.mapToTargetIds(args.ids), function () {
$$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true}); $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
if (args.done) { args.done(); } if (args.done) { args.done(); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment