Angular-nvd3 issue, failed to update chart when set data to newData

后端 未结 2 1351
-上瘾入骨i
-上瘾入骨i 2021-01-23 15:52

It is a strange issue not only about nvd3 directive, I have steped into the directive source code, but still not find the reason.
I put it in plunker, switch co

2条回答
  •  借酒劲吻你
    2021-01-23 16:04

    Since the version 1.0.2 you might also want to set deepWatchData as true. There was a commit on 15/09/2015 and now this option by default is false which means that Angular's watch expression will not track changes in array with data.

    No need in doing scope.api.refresh() with this settings. No need in rewriting of the whole array of data, with new portion of data you just add/push it to array. This will help to prevent flashing when reassigning new data.

    Now instead of:

    should be:

提交回复
热议问题