-1

I am trying to add a rChart and nvd3 plot a shiny dashboard.

However only the top part of the graph shows. and does not even fill the panel which is created.

my code ui code is

    showOutput("myPlot")

I have also tried to alter it using the following

div(class='wrapper', tags$style(".Nvd3{ height: 700px;}"),
    showOutput("myPlot"))

but all this seems to do is create a box the same colour as the shiny dashboard side bar.

My server code #

output$myPlot<- renderChart({
                 plotdataukv <- nPlot(verifiedUsers ~ date, group="group", data = myData, type = 'lineChart', dom = 'myPlot')
                 plotdataukv$xAxis(axisLabel = 'Time (Days)', tickFormat="#!function(d) {return d3.time.format('%d/%m/%Y')(new Date( d * 86400000 ));}!#", rotateLabels=-90 )
                 plotdataukv$yAxis(axisLabel = 'My Metric')
                 plotdataukv$chart(color = c('blue', 'red'))
                 return(plotdataukv)
})
Stephen Saidani
  • 101
  • 1
  • 2
  • 8
  • 1
    Can you provide some test data along with a test app so we can reproduce the problem please – Pork Chop Sep 23 '15 at 14:03
  • The issue you described also appears when we try to include a leaflet plot and a nvd3 plot within same shiny app. Try disabling all other plots except this one and see if the issue still remains. – anonR Sep 26 '15 at 18:27

1 Answers1

0

Code:

output$myPlot<- renderChart({
             plotdataukv <- nPlot(verifiedUsers ~ date, group="group", data = myData, type = 'lineChart', dom = 'myPlot')
             plotdataukv$xAxis(axisLabel = 'Time (Days)', tickFormat="#!function(d) {return d3.time.format('%d/%m/%Y')(new Date( d * 86400000 ));}!#", rotateLabels=-90 )
             plotdataukv$yAxis(axisLabel = 'My Metric')
             plotdataukv$chart(color= c('blue', 'red'))

               plotdataukv$set(dom = 'myPlot')

             return(plotdataukv)
})

showOutput("myPlot", "nvd3")

I hope the above code is working properly..

Evan Carslake
  • 2,267
  • 15
  • 38
  • 56
shanu
  • 1
  • 1