0

我已经使用 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;
4

1 回答 1

0

目前 nodeDisplay 是一个全局设置,不能为每个节点定制。

每个节点的显示类型肯定会在我们开发图表时实现。

于 2014-05-06T08:00:06.007 回答