I tried playing with the SVG dimensions but the text is cutting off.
Code for X-axis:
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.append("text")
.attr("x", width / 2 )
.attr("y", margin.bottom + 5)
.style("text-anchor", "middle")
.style("font-size", "150%")
.text("Age in Years");
How do I fix this?
Tried by increasing the margin bottom variable defined.
But that didn't work.
When i added +10 in this line .attr("height", height + margin.top + margin.bottom + 10)
.
It's displaying fine now.
fiddle
.
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.