Accepted answer

If you are re-using that same directive for each chart, then in your template your div id isn't unique. This:

var chart ="#chart").append("div") 

will append to the first div with id chart.

Instead, in your link function find the div from the element variable.


returns the DOM elements in your template.

With your template to find the first child of the outer div should be (untested):[0]));

Related Query