根据zoomcharts库中的link.label设置样式链接

时间:2014-04-09 20:14:03

标签: hyperlink styling zoomcharts

尝试设置链接样式..

图表已

        linkRules:{"rule1":linkStyle},

和函数定义为

        function linkStyle(link){
            switch (link.label)
            {
            case "Executes": 
                link.fillColor = "blue";
                link.radius = 4;

            case "Benefits": 
                link.fillColor =  "green";
                link.radius = 2;

            default:
                link.fillColor = "#000000";
                link.radius = 1;
            };
            link.toDecoration="arrow";
        }

但没有按预期工作..

1 个答案:

答案 0 :(得分:1)

知道了:)我忽略了包括"休息;"声明和每个案件的结尾。

        function linkStyle(link){
            switch (link.label)
            {
            case "Executes": 
                link.fillColor = "blue";
                link.radius = 4;
                break;  
            case "Benefits": 
                link.fillColor =  "green";
                link.radius = 2;
                break;  
            default:
                link.fillColor = "#000000";
                link.radius = 1;
            };
            link.toDecoration="arrow";
        }