简体   繁体   中英

add color to node dagre d3

I have created a tree structure following the link Reading DOT files in javascript/d3

I need to fill the nodes with color.

Tree data:

在此处输入图片说明

I tried adding

[label="abcd" labelStyle="font: 300 14px" style=filled fillcolor=red]
[label="abcd" style=filled color=red]

Could anyone please suggest or point me in right direction.

Thanks

In you CSS section add this

.node rect {
            stroke: #333;
            fill: #ff0000;
        }

This will make your node color red.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM