当我使用 Shiny 运行 rCharts 时,只有绘图的顶部显示在我的本地控制台中。我完全不知道为什么会这样,我正在运行 rCharts 和 Shiny 的最新开发版本。任何帮助将不胜感激!
下面的两个文件应该完全重现该问题。在此先感谢,塞巴斯蒂安
## server.R
require(rCharts)
library(RCurl)
options(RCHART_WIDTH = 800)
shinyServer(function(input, output) {
output$myChart <- renderChart({
x <- getURL("https://raw.github.com/sebastianbarfort/vaa/master/vaa_.csv")
df___ <- read.csv(text = x)
p2 <- nPlot(Economy ~ Immigration, group = 'X.1', data = df___,
type = 'scatterChart')
p2$chart(color = c('red', 'blue', 'green',"yellow","yellow","yellow","yellow","yellow"))
p2$set(dom = "myChart")
return(p2)
})
})
##ui.R
require(rCharts)
shinyUI(pageWithSidebar(
headerPanel("xxx"),
sidebarPanel(
selectInput(inputId = "x",
label = "Choose X",
choices = c("CL", "Economy", "Education", "Envrionment", "EU",
"FP", "Health", "Immigration"),
selected = "Economy"),
selectInput(inputId = "y",
label = "Choose Y",
choices = c("CL", "Economy", "Education", "Envrionment", "EU",
"FP", "Health", "Immigration"),
selected = "Immigration")
),
mainPanel(
showOutput("myChart","Nvd3")
)
))
如果从 Github 加载 csv 失败(如果加载 RCurl 则不应该),这里是 Github 上数据的直接链接: https ://github.com/sebastianbarfort/vaa/blob/master/vaa_.csv