Wednesday 15 February 2012

r - shiny with rNVD3 work well in rstutio but only show half of the chart in chrome -



r - shiny with rNVD3 work well in rstutio but only show half of the chart in chrome -

i using rnvd3 in shiny create charts, works in rstudio gives error message:

error: [on_request_read] connection reset peer

i don't know what's wrong

but when open app in chrome or firefox charts show top half (i don't have plenty reputation post images, sorry)

the code :

#ui.r require(rnvd3) library(shiny) shinyui(pagewithsidebar( headerpanel("rnvd3: interactive charts r using nvd3.js"), sidebarpanel( selectinput(inputid = "gender", label = "choose gender", choices = c("male", "female"), selected = "male"), selectinput(inputid = "type", label = "choose chart type", choices = c("multibarchart", "multibarhorizontalchart"), selected = "multibarchart"), checkboxinput(inputid = "stack", label = strong("stack bars?"), value = false) ), mainpanel( showoutput("mychart") ) )) #server.r require(rnvd3) shinyserver(function(input, output) { output$mychart <- renderchart({ hair_eye = as.data.frame(haireyecolor) p6 <- nvd3plot(freq ~ hair | eye, info = subset(hair_eye, sex == input$gender), type = input$type, id = 'mychart') p6$chart(color = c('brown', 'blue', '#594c26', 'green'), stacked = input$stack) return(p6) }) })

r shiny nvd3.js rcharts

No comments:

Post a Comment