Skip to content

plotlyOutput height 100% does not work (width does) #1495

Closed
@ambevill

Description

@ambevill

It is possible to pass width='100%' into plotlyOutput so that the plot takes all of the horizontal space. The help text also suggests height='100%' as an example, but this always results in a 400px static height.

However, plotly plots are usually 100% height and width when the graphs are stand-alone HTML, so I'm not sure why it wouldn't be possible to have 100% height within a Shiny app.

library(shiny)

ui = shinyUI(fluidPage(plotly::plotlyOutput('plot', width='100%', height='100%')))

server = shinyServer(function(input, output, session) {
  output$plot = plotly::renderPlotly({ plotly::plot_ly(data=airquality, x=~Ozone, y=~Solar.R) })
})

runApp(list(ui=ui, server=server))

Output screenshot:

Capture

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions