Angular-nvd3-directive piechart nodata not updating

I am using angular-nvd3 piechart directives. I am setting up a piechart with a list of values ​​with siteId (as x-axis) and usersCount (as y-axis). Typically an application starts with one set of objects (siteId, usersCount). The app allows users to modify the list of site sets - (siteId, usersCount) List, and when a new list is loaded and there is no data in it, piechart prints the text nodata, but piechart stays behind the text with the previous data.

I used nv.graphs [0] .update () to update it, but that seems to be unacceptable. I also set the objectequality attribute to true (for deep data observation).

The list of data looks like this in debug: {object [1]} - when there is data, and {object [0]} - when there is no data.

Thank you very much in advance.

+3


source to share


1 answer


You should check the chart function inside the nvd3. Whenever there is no data on the pie, a chart is returned in which the function exists without refreshing the view. Try removing the return statement and see if it works for you.



+4


source







All Articles