ps0604 ps0604 - 1 year ago 76
AngularJS Question

Dynamically creating mutiple Highcharts charts in Angular directive

In my directive template I have

<div id="chartdiv-{{name}}" style="width:100%;height:100%"></div>

where name is variable and assigned to each directive when it is created.

The chart is created with


But this doesn't work. Everything works fine if I don't use the
variable. Any ideas?

Answer Source

Change it like this,

<div id="{{ 'chartdiv-' + name }}"></div>


If you are creating template inside a directive, it should be

<div id="chartdiv-{{$}}"></div>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download