尝试添加:
.attr("style", function(d) { return ("stroke-width:" + d.weight + "px;");})
First remove this line from your path.link
class from CSS file.
stroke-width: 2.0px;
Then, in your java-script file add following line in path
variable.
.attr("stroke-width", function(d) { return (d.weight); })
Another method by which you can override the style property which @drone6502 suggested, is to add style
attribute. Here, no need to remove stroke-width
from CSS.
.attr("style", function(d) { return ("stroke-width:" + d.weight + "px;");})
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.