Scrolling on a SVG element

8,268 views
Skip to first unread message

ice

unread,
Apr 4, 2014, 9:47:25 AM4/4/14
to d3...@googlegroups.com
Hi, 

I am trying to enable scrolling on a svg element but can't. I added css overflow scroll but that didn't work either.
For example this is the result I get: 

Instead of cutting off the rectangles, I would like a scrollbar to appear which will allow the user to see the rest of the rectangles. 
Can someone please point me in the right direction? Are there ways around this problem? 

Thank you. 

Erkal Selman

unread,
Apr 4, 2014, 9:53:57 AM4/4/14
to d3...@googlegroups.com
you should resize the svg element and put it inside a div which has the css overflow scroll.

icy water

unread,
Apr 4, 2014, 3:25:52 PM4/4/14
to d3...@googlegroups.com
Thanks for replying! :) 
Is there any other way instead of resizing the svg element? I am asking as the scroll bar will always be visible even when the number of rectangles is small, I was trying to make it appear dynamically like the kinda of thing you can do with html pages, scrollbar appears if there is more information on a page. 




--
You received this message because you are subscribed to a topic in the Google Groups "d3-js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/d3-js/exMDZSXcpGw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to d3-js+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Erkal Selman

unread,
Apr 4, 2014, 3:36:47 PM4/4/14
to d3...@googlegroups.com
It should behave as you want if you resize the svg element according the number of your rects.

Rajsree Shanmugavadivel

unread,
Mar 21, 2016, 6:16:24 AM3/21/16
to d3-js, erkal...@gmail.com
@ Erkal Thanks for the idea.. I tried using in my application and it is working :)

kandulapati siva

unread,
Jul 18, 2017, 3:17:32 AM7/18/17
to d3-js
Hello,
I am also facing this issue.. Could you please share me the solution you have implemented to acheive this?

Thanks
Siva
Reply all
Reply to author
Forward
0 new messages