Meori Lehr
Meori Lehr

Reputation: 193

angular-nvd3-directives piechart nodata not refreshing view

i'm using angular-nvd3-directives piechart. I'm setting the piechart with a list of values with siteId (as x axis) and usersCount (as y axis). The application usually starts with at list one set of (siteId, usersCount) object. The application allows the users to change the list of site sets - (siteId, usersCount) List, and when the new list is loaded and there is no data in it, the piechart prints the nodata text, but the piechart stays behind the text with the previous data.

I used the nv.graphs[0].update() to refresh it, but it seems not natural. I also set the objectequality attribute to true (for the deep watch on the data).

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

many thanks in advance :)

Upvotes: 3

Views: 392

Answers (1)

Amit Ben Ami
Amit Ben Ami

Reputation: 548

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

Upvotes: 4

Related Questions