0
私はソートd3チャートを描く際に問題があります。各ボタンが選択されたときに、カテゴリテキストを表示することができました。D3強制バブルチャートの描画方法
私の問題はノードのコード内にありますか?
var nodes = svg.selectAll("circle")
.data(data);
nodes.enter().append("circle")
.attr("Pclass", "node")
.attr("cx", function (d) { return d.x; })
.attr("cy", function (d) { return d.y; })
.attr("r", function (d) { return d.radius; })
.style("fill", function (d) { return fill(d.pclass); })
.on("mouseover", function (d) { showPopover.call(this, d); })
.on("mouseout", function (d) { removePopovers(); })
var force = d3.layout.force();
draw('Pclass');
私のフルPlunkerはここにある:https://plnkr.co/edit/JFbPzy7nI1oAyO1Rb9wC?p=preview
'.ATTR( "R"、関数(D){戻りd.radius;}).comb' d.radiusがnullをあなたが '.attr(" r "、function(d){return 10;})しようとすると'円が現れますが、うまく広がらないでしょう。 :https://plnkr.co/edit/5BTuDxXYVxyH0zx1WgJi?p=preview – mkaran
'data [j] .comb'は定義されていないので、この' data [j] .radius = + data [j]のため、d.radiusはnullです。 comb/2; 'はNaNで終わります。これを見てみましょう:https://plnkr.co/edit/5BTuDxXYVxyH0zx1WgJi?p=previewここで、NAgeを使って半径を計算しています。お役に立てれば! – mkaran
ありがとう!これは完璧な意味合いがあります。私がこのページをチェックする前に、答えは私の頭に浮かんだ。それは確かにコードで非常に小さなエラーでした –