I would like to have diagram similar to this one: (the most important part is that I would like to have node text displayed in several colors; it doesn't matter whether the diagram is tree or cluster)
This is a test example:
jsfiddle
I tried changing text color via CSS
, and within JavaScript
code, bit it always remains black. Why?
I would like to have diagram similar to this one: (the most important part is that I would like to have node text displayed in several colors; it doesn't matter whether the diagram is tree or cluster)
This is a test example:
jsfiddle
I tried changing text color via CSS
, and within JavaScript
code, bit it always remains black. Why?
1 Answer
Reset to default 8I found the answer:
fill: #5555ff;
in CSS for node/text solves the problem.
SVG text element does not care about color
attribute, like other HTML elements. Setting fill
is the right way.