It seems that type is not in the scope bindings of this directive.
So I updated the examples, since they are not working.
Or you can change the directive to add it to the bindings. That is your choice what you prefer ...
Also I would prefer that
if ($scope.chart) { type = $scope.chart; }
should be extended that type has a fallback value, like line chart. So that the code will not crash if type is not set.
It seems that type is not in the scope bindings of this directive.
So I updated the examples, since they are not working.
Or you can change the directive to add it to the bindings. That is your choice what you prefer ...
Also I would prefer that if ($scope.chart) { type = $scope.chart; } should be extended that type has a fallback value, like line chart. So that the code will not crash if type is not set.