0

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?

Here is the Plot

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))
jbelmonte
  • 25
  • 5
  • 2
    Can you make a minimal [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with some sample data so we can actually run the code and a minimal shiny wrapper so we can copy/paste the problem to re-create it? It may have more to do with your shiny CSS and theme-ing but hard to say without a reproducible example. – MrFlick Jan 22 '19 at 13:44
  • I added the UI, and im not sure how to add reproducible data and it works in Rstudio its just when deployed to shiny server tha it gives issues – jbelmonte Jan 22 '19 at 13:49
  • He gave you a link showing how to make a reproducible example. That explains use of things like `dput` that are used for reproducing data. Right now, this question is almost impossible to answer. If you want help you need to make sure we can run it on our machines – Conor Neilson Jan 22 '19 at 15:51

0 Answers0