ggplotly&展开窗口时,plotly缺少值

时间:2018-10-26 06:41:10

标签: html r ggplot2 shiny shinydashboard

我正在创建一个闪亮的应用程序,并使用plotly和ggplotly。由于某种原因,当我扩大窗口的大小时,该图会丢失一些数据点。非常感谢您的帮助。 enter image description here
enter image description here

 dashboardBody(
      tabItems(
        tabItem(
          tabName = "calendar",
          fluidRow(width = 12,
                   column(width = 8, 
                   box( width = NULL, height = 400, 
              title = "Yang Zhang Estimator", solidHeader = T, status = "danger",

              plotlyOutput("yang_zhang", height = "320px")
            )) ...  


     server <- function(input, output) {

   spy = getSymbols("SPY", from = Sys.Date()-100, to = Sys.Date(), auto.assign =F)

   yz_vol = reactive({
   volatility(spy, n = as.numeric(input$slider_yz), calc = "yang.zhang", N = 252, 
   mean0 = F)
  })

   output$yang_zhang = renderPlotly({
   plot_ly(as.data.frame(yz_vol()), x = as.Date(index(yz_vol())), y = 
   as.numeric(yz_vol()), type = "scatter")

  }) 


 }

0 个答案:

没有答案