Overflow in div of the graph

63 views
Skip to first unread message

Mishelle Uchuari

unread,
Sep 20, 2017, 2:45:56 AM9/20/17
to d3-js
I'm generating a d3 graph using a Json wich I am getting making a query against a data repository, so the size of the graph is diferent every time depending the data size. I can't put a fixed height to the svg div container because with a query and it's respectives results the hight is correct but with another one not, with the width I haven any problem because I am fixing 100%, but with the height that isn't works. I have been looking for a solution for this problem I found I have to play with the viewbox value and preserveAspectRatio="xMidYMid meet" but isn't works. Do you have idea if it is possible get svg real height not the the height of the div where svg is contained after svg creation for do a redraw with this real heigh? In the JsFiddle I attach you can see the graph is out of the div and I want the graph fit in the div. Thanks for your attention.

Mishelle Uchuari

unread,
Sep 20, 2017, 2:51:02 AM9/20/17
to d3-js

And when I change the CSS propierty "overflow:visible" I realized that the d3 graph is ocuppating another div space. 

Reply all
Reply to author
Forward
0 new messages