Allow AJAX charts

Sometimes (usually IMHO) the chart's data isn't present during initialization.
In this case the code throws an exception bcz $scope.data is not defined when calling chart[$scope.type]($scope.data, $scope.options);

I added a simple if statement to resolve this issue. You can now define a chart and then fetch its data using AJAX...