Reputation: 73
I have d3 graph with xaxis and Y axis.I want to add axis to the top and right to make it look like a box. Something like This.
Upvotes: 0
Views: 273
Reputation: 1732
You could go through this article for adding multiple axes. You should create new axis generators and give the orient
as 'right' and top
and call them finally.
http://www.d3noob.org/2013/01/using-multiple-axes-for-d3js-graph.html
EDIT:
I have made a simple line chart with your requirements. Have a look at https://jsfiddle.net/j0kaLf59/
Also as mentioned in the comments, you could just add two line elements. Have a look at this fiddle https://jsfiddle.net/a6o2hkfq/
Reference:
Upvotes: 1