Closed gregorbaird1 closed 3 years ago
in: api.region.ts function: Chart.prototype.regions.remove = function (options) {.........
the code snipit
config.regions = config.regions.filter(function (region) { var found = false; if (!region['class']) { return true; } region['class'].split(' ').forEach(function (c) { if (classes.indexOf(c) >= 0) { found = true; } }); return !found; });
does not remove the regions from config.regions because the filter function always returns true.
in my opinion the code should be:
config.regions = config.regions.filter(function (region) { if (!region['class']) { return true; } region['class'].split(' ').forEach(function (c) { if (classes.indexOf(c) >= 0) { found = true; } }); return false; });
ie the filter function should return false to remove the region
Sorry suggested code is wrong. And now I can't work out why the original code does not remove the regions from the config Sorry will keep looking
in: api.region.ts function: Chart.prototype.regions.remove = function (options) {.........
the code snipit
does not remove the regions from config.regions because the filter function always returns true.
in my opinion the code should be:
ie the filter function should return false to remove the region