Html::_ is desired because it prevents XSS while Html::ifSet does not. However, nvd3 does not render the HTML-safe characters correctly. If nvd3 could render HTML-encoded characters correctly that would be great. Another solution could be to use HTML::ifSet but strip any quotes out first to avoid the possibility of the name breaking the JSON format and introducing its own JS via XSS.
The graphs failing to load sometimes is a separate issue. The JS for d3/nvd3 could not be loaded before the widget since they are defined and used from inside the widget. I don't see that as a workable solution in any case because it could end up causing a race condition (e.g. maybe the widget loads before the JS loads anyway) that leads to the same issue, assuming the race condition is the issue in the first place. The JS is already set to load in its required order of (1) d3 (2) nvd3 (3) generate graphs.