nodeRules を使用して、ノードのタイプに応じてノードの特定のスタイルを設定しました。現在、nodeDisplay 設定を無効にする方法を探しています。私が達成したいのは、使用可能な node.image がない場合に、ラベルが表示されることです。
私のチャートには次のものがあります:
style:{
nodeRules:{"rule1":nodeStyle},
linkRules:{"rule1":linkStyle},
linkLabel:{textStyle:{font:"12px Arial", fillColor: "black"}, backgroundStyle:{fillColor:"#FFF", lineColor:"black"}},
makeImagesCircular:true,
nodeDisplay:"image"
},
私のnodeStyle関数では、次のようなものが欲しいです:
case "organization":
node.radius = 40;
node.fillColor = "red";
node.lineColor = "red";
node.labelStyle= {textStyle:{font:"14px Arial",fillColor:"black"}};
$.ajax({
url:'/img/'+node.id+'.png',
type:'HEAD',
error: function()
{
// here the chart's nodeDisplay settings would be overruled
node.display="roundtext";
},
success: function()
{
node.image= "/img/"+node.id+".png";
}
});
break;