I have my d3 chart title, text append on the svg as per below:
svg.append("text") .attr("x", (width / 2)) .attr("y", 0) .attr("text-anchor", "middle") .style("font-size", "14px") .text(text);
reference here
But I would like to set the text color to some other color. Is that possible?
All the while I was doing .style("fill", "darkOrange")
Then I found out the correct answer is
.style('fill', 'darkOrange')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With