Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using string interpolation for the data attribute value of the pie-chart directive. #9

Open
jstralko opened this issue May 19, 2015 · 1 comment

Comments

@jstralko
Copy link

I need to generate a number of pie charts dynamically based on data from a database. So I don't know how many pie charts I need to create so I need the data attribute to be string that is generated via string interpolation.

This way gives a syntax error:



I tried to modify the custom pie directive to something like this in the link function:

$parse(attrs.data)($scope.$parent);

But I get the following error:
TypeError: u.map is not a function
at Object.n as pie
at Object.updatePaths (pie-chart.js:100)
at draw (pie-chart.js:44)
at hard_update (pie-chart.js:30)
at Object.fn (pie-chart.js:56)
at n.$get.n.$digest (angular.js:14308)
at n.$get.n.$apply (angular.js:14571)
at l (angular.js:9698)
at M (angular.js:9888)
at XMLHttpRequest.F.onload (angular.js:9829)

Am I overlooking something simple or does the pie-chart directive not support this use case?

Anyways thanks for the help!

@hellsan631
Copy link
Contributor

The data that is being sent into the chart isn't an array, which it needs to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants