0

I am having trouble having highcharts bind to a dynamic chartConfig using this approach

where charts is an object in the controller housing multiple charts by the keys "{{moment}}_a".

When the page resolves, the highcharts has the right output, for e.g.

config="charts['ABC-DEF_a']" but the chart and data don't display. If I manually type the same config="charts['ABC-DEF_a']" into the page, it displays fine.

How do I ensure that highcharts binds to the variable referenced?

Thanks

Noel Euzebe
  • 95
  • 2
  • 9
  • It might have something to do with the directive not watching (correctly) when the config parameter is changed. If you look at the code https://github.com/pablojim/highcharts-ng/blob/master/src/highcharts-ng.js perhaps you can figure something out? :-| – Patrick Feb 10 '15 at 16:47

1 Answers1

0

If you use for example config="chartConfig" you edit it via controller by $scope.chartConfig = {}; and after any dynamic change you must call $scope.$apply();

gsamaras
  • 71,951
  • 46
  • 188
  • 305
Aivus
  • 502
  • 5
  • 15