1
I made a chart with Morris.js https://morrisjs.github.io/morris.js/donuts.html
and put it inside a return of a query, so far everything right, but when I call this query again to generate other data on the graph, it generates another graph, is duplicating, instead of just exchanging information, it creates another graph and is 2
As I change the option, it generates a new chart...
My code
 $scope.selectAction = function(myOption) {
       $http.get('http://localhost/Angularjs/php/TotalAlunos.php?cod=' + $scope.myOption.id).then(function(result){    
        Morris.Donut({
          element: 'donut-example',
          data: [
            {label: "In-Store Sales", value: result.data.total},
            {label: "Mail-Order Sales", value: 20}
          ]
        });
      });
};
