我正在创建一个闪亮的应用程序,并使用plotly和ggplotly。由于某种原因,当我扩大窗口的大小时,该图会丢失一些数据点。非常感谢您的帮助。
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")
})
}