Sto usando nvd3.js insieme a angularjs, ecco il codice.Errore d3.js: valore non valido per <g> attributo transform = "translate (NaN, 5)"
<nvd3-pie-chart data="exampleData1"
class="pie"
id="labelTypePercentExample"
x="xFunction()"
y="yFunction()"
showLabels="true"
pieLabelsOutside="true"
showLegend="true"
labelType="percent">
</nvd3-pie-chart>
e js è.
myapp.controller('ExampleCtrl1',function($scope,$timeout){
$scope.exampleData1 = [
{ key: "Ongoing", y: 20 },
{ key: "completed", y: 0 }
];
$timeout(function() {
$scope.exampleData1 = [
{ key: "Ongoing", y: 20 },
{ key: "completed", y: 2 }
];
}, 10);
$scope.xFunction = function(){
return function(d) {
return d.key;
};
}
$scope.yFunction = function(){
return function(d) {
return d.y;
};
}
})
ed è un errore di lancio, sul ridimensionamento della pagina.
Errore: valore non valido per l'attributo trasformare = "tradurre (Nan, 5)" d3.js: 590
apparentemente translate riceve Not a Number value, ma non riesco a vedere l'attributo g qui, puoi creare plunker con il tuo codice? – maurycy
Ho provato il tuo esempio con la direttiva [this] (http://krispo.github.io/angular-nvd3/#/), e sembra che non ci siano problemi. Prova [demo] (http://plnkr.co/edit/QwzhMO?p=preview). – krispo
https://github.com/krispo/angular-nvd3/issues/17 – Ben