javascript - changing text font through css for specific text in d3 -
I am using the d3 framework and I am trying to specify the font to the following element using CSS ( I want to use a custom font, this is the reason I am using CSS)
var anchorNode = svg.selectAll ("g.anchorNode"). Data (force2.nodes ()). Enter () Append ("svg: g"). Attr ("class", "anchor note"); AnchorNode.append ("svg: cycle"); AnchorNode.append ("svg: text") text ("test") ;. I tried to use
text {font: 2px Arial; Pointer-phenomena: none; } But it does not work for this specific text. I'm assuming that this is because the text is added to the node. What will be the correct syntax for accessing text in CSS?
Do you have a link to a car or a JSFDL?
It seems that by adding a class named your annornode, you may update the CSS font for that category:
.anchorNode {font-family: "Times New Roman ", Times, serif; Font-size: 2px; }
Comments
Post a Comment