Add a scroll bar to larger tables and larger bar charts?

2,926 views
Skip to first unread message

stephen....@gmail.com

unread,
Aug 14, 2014, 12:20:47 PM8/14/14
to shiny-...@googlegroups.com
Hi Shiny dev team,

Is there a supported path to scroll-bars in tables or bar charts?  I am using ggvis for the bar chart, but can consider ggplot2.

Another alternative is to use an iframe for a ui object?  This appears to only support a web page, not a ui element like ggvisOutput("ggvis2")

Thanks,
Stephen

Jonathan

unread,
Aug 14, 2014, 4:05:27 PM8/14/14
to shiny-...@googlegroups.com
In ui.R, you can wrap your xxxOutput with a div, specify a size, and specify overflow scrolling. 

Example vertical scroll:

div(style='height:600px; overflow-y: scroll',
   tableOutput("view")
)

Example scroll both directions:

div(style='height:600px; width:300px; overflow: scroll',
   tableOutput("view")
)

It would be nice to specify the size as a percentage of the browser window with notation such as 80% instead of 600px. But I haven't been able to get that to work. Anyone else?

Jonathan
Reply all
Reply to author
Forward
0 new messages