【问题标题】:Overruling chart.style.nodeDisplay in nodeRule in zoomcharts在 zoomcharts 中的 nodeRule 中推翻 chart.style.nodeDisplay
【发布时间】:2014-05-01 08:18:12
【问题描述】:

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

【问题讨论】:

    标签: zoomcharts


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多