How to use plotly for graphical representation

Hi Community, I am trying to add graph for the output which i have generated using shiny. I am getting error for graph generation. Can someone please have a look and assist.

I am getting error for unused argument

output$graph<- renderPlotly({
  
  plotly( x= c(as.numeric(input$contract), round(frateperton()), differencerate()),
          
         y= c('Contract Rate', 'ZBC Rate', 'Difference'),
         
         name = "Zero Based Rate Chart",
         
         type = "bar")
  
})


Hi,

You'll find some interesting resources and examples in the plotly book https://plotly-r.com/

For shiny, I would advice to work on the plot with example data outside of shiny, then include in shiny app and use the correct reactive value.

For now, we don't have enough information to know what is going wrong in your case. Please follow the guide to create a reprex: Shiny debugging and reprex guide
so that you help us help you.

One thing is that the function to create graph in plotly :package: is plot_ly as in the doc 2 Overview | Interactive web-based data visualization with R, plotly, and shiny
Here you are using plotly which I don't think is used how you think. Check ?plotly::plotly
It says

This function is now deprecated. It used to provide a way to store plotly account credentials, but that can now be done with environment variables. For more details and examples, see Getting started with plotly in R.

If you're here looking for an intro/overview of the package, see the readme

Hope it helps

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.