Skip to content

Commit

Permalink
Merge pull request gonewandering#54 from adam7/master
Browse files Browse the repository at this point in the history
Fixed 'chartCreated is undefined' error
  • Loading branch information
gonewandering committed Aug 28, 2014
2 parents 0859278 + 0d112d0 commit 9dfc878
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions angles.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ angles.chart = function (type) {
angular.element($elem[0]).parent().after( chartCreated.generateLegend() );
}, true);

$scope.$watch("tooltip", function (newVal, oldVal){
chartCreated.draw();
$scope.$watch("tooltip", function (newVal, oldVal) {
if (chartCreated)
chartCreated.draw();
if(newVal===undefined || !chartCreated.segments)
return;
if(!isFinite(newVal) || newVal >= chartCreated.segments.length || newVal < 0)
Expand Down

0 comments on commit 9dfc878

Please sign in to comment.