I have two pages in my flexdahboard, they both use shiny, sometimes the ledgend is cut off and sometimes it is not. I cant figure out why. It also is not using the full page. Is there a way to fix this?
I have tried messing with Figsize but it didnt work and I thought ggplotly was supposed to self size?
---
title: "Margin Analysis"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    theme: cosmo
runtime: shiny
---
shinyApp(
ui <- fluidPage(sidebarLayout(
sidebarPanel(
  selectInput("Group_By",
                 label = "Group By",
                 choices = c("ProductClass",  "ItemClassDesc"),
                 selected = 'ProductClass'),
  selectizeInput("Product_Class",
                 label = "Product Class",
                 choices = unique(reg_by_prod$ProductClass),
                 selected = unique(reg_by_prod$ProductClass)[1]),
  selectizeInput("Item_Class",
                 label = "Item Class",
                 choices = unique(reg_by_prod$ItemClassDesc),
                 selected = unique(reg_by_prod$ItemClassDesc)[1]),
  width = 2
),
mainPanel(
  plotlyOutput('graph'),
  dataTableOutput('table')
))),
server <- function(input, output, session){
 ggplotly(ggplot(fiscal_tidy_var, aes(as.numeric(month), Value, color = Delta))+
             geom_point(size = 2)+
             geom_line(size = 1.25, alpha = .75) +
             scale_x_continuous(breaks = 1:12, labels = c('Oct', 'Nov', 'Dec',
                                                          'Jan', 'Feb', 'Mar',
                                                          'Apr', 'May', 'Jun',
                                                          'Jul', 'Aug', 'Sep'))+
             xlab('Month') +
             ylab('Percent Delta') +
             geom_ribbon(aes(ymax = 0, ymin = min(Value)),
                         fill="red",colour=NA,alpha=0.1) +
             geom_ribbon(aes(ymax = max(Value), ymin = 0),
                         fill="green",colour=NA,alpha=0.1) +
             theme_minimal() +
             ggtitle(input$Item_Class))
