在jointjs中无法更改UML状态的颜色

时间:2017-03-10 05:21:25

标签: javascript html5 css3 jointjs

我是关于联合的新手,我尝试使用以下命令更改UML状态图的颜色:

graph.getElements()[4].attributes.attrs[".uml-state-body"]["fill"] = "#ff0000";

但它并没有改变国家的颜色。

1 个答案:

答案 0 :(得分:0)

改为使用API​​方法:

graph.getElements()[4] .attr(' .uml-state-body / fill','#ff0000')

http://resources.jointjs.com/docs/jointjs/v1.0/joint.html#dia.Element.prototype.attr