Trying to use nvd3-line-chart directive in my AngularJS app, but it does not redraw on changing the underlying model...
I'm new to AngularJS, so might be something obvious to an experienced Angular programmer, but drives me nuts :-)
Searching for similar issues on stackoverflow only turned up answer dealing with more sophisticated issues like realtime charting or the likes - but I'd just want to push new data once on link click...
I've prepared a Plunker example here:
http://plnkr.co/edit/TkyHhbfi0vNw1FJ6mYZC?p=preview
Directive is being used like that:
<nvd3-line-chart data="exampleData" showXAxis="true" showYAxis="true"
tooltips="true" xAxisTickValues="xAxisTicks()"
xAxisTickFormat="xAxisTickFormat()"
yAxisTickFormat="yAxisTickFormat()" interactive="true" objectEquality="true">
</nvd3-line-chart>
(also tried with objectEquality=false, but behaviour didn't change)...
Then in my js code I set new content in a subfunction (callback from http transfer) with:
$scope.exampleData = data;
To be sure everything get's called as wanted, also added some label (xxx) and modified it in the function call from click to yyy which works - so data binding and scope availability seems ok?
Same function is also used for initial fill, which works fine...
Can anybody shed some light regarding this issue?
BTW; also found a working example but can't spot the difference (apart from them calling it from native js so they need to manually update the component which didn't work for me as I'm already in a angular update cycle):