Skip to content

Commit

Permalink
Fix chart being created on results page when no results are present a…
Browse files Browse the repository at this point in the history
…t load
  • Loading branch information
adambutler committed Nov 9, 2014
1 parent 3f08f96 commit f2184b8
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,19 @@ angular
else
$scope.chartData = $.extend true, $scope.chartData, data

total = 0
for datum, index in data
total += datum.value

console.log "Total = #{total}"

if $scope.chart?
console.log 'a'
for datum, index in data
$scope.chart.segments[index].value = datum.value
$scope.chart.update()
else
else if total > 0
console.log 'b'
$scope.chart = new Chart($scope.ctx).Doughnut($scope.chartData, $scope.chartOptions)


Expand Down

0 comments on commit f2184b8

Please sign in to comment.