当我在Shiny中运行rCharts时,只有图形的顶部显示在我的本地控制台中。我完全不知道这是为什么,我正在运行最新的rCharts和Shiny开发版本。非常感谢任何帮助!以下两个文件应该可以完全重现这个问题。谢谢你提前的帮助,Sebastian。
如果从Github加载csv文件失败(如果你使用RCurl应该不会出现这种情况),这里有一个直接链接到Github上数据的链接:https://github.com/sebastianbarfort/vaa/blob/master/vaa_.csv。
## 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。