Skip to content

Commit

Permalink
Fix memory leak, force destroy old charts
Browse files Browse the repository at this point in the history
  • Loading branch information
yienyien committed Mar 2, 2017
1 parent 62194ef commit 754eeac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions public/c3_vis_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ module.controller('KbnC3VisController', function($scope, $element, Private){
config.point = {"show": !$scope.vis.params.hidePoints};
config.zoom = {"enabled" : $scope.vis.params.enableZoom};

// Destroy last chart if exists
if($scope.chart !== null) {
$scope.chart.destroy();
}
// Generate and draw
$scope.chart = c3.generate(config);

Expand Down

0 comments on commit 754eeac

Please sign in to comment.