You need to change how you provide the element in the renderTo
of HighCharts.
Change
var chart = new Highcharts.Chart({
chart: {
renderTo: "container",
...
},
...
});
To
var chart = new Highcharts.Chart({
chart: {
renderTo: element[0],
...
},
...
});
You should also remove the id="container"
part from the template, you don't need it there and like I mentioned in my comment, it is invalid html to have more than element with the same id.