如何从图中的选定部分获取数据

时间:2018-04-05 08:28:46

标签: r shiny plotly ggplotly r-plotly

please have a look

我想从饼图的选定部分获取数据,假设我选择蓝色部分,如图所示,我从该部分获得数据,即二月

shinyServer(function(input, output, session) {

    usvltdyearstore1 = data.frame(
      Sold_that_area=as.numeric(as.character(usvltdprodmonyear$QTY)),
      Month =usvltdprodmonyear$MONTHNAME,
      TOTAL= usvltdprodmonyear$TOTAL,
      stringsAsFactors = FALSE
    )
    output$usvltdmonthprod=renderPlotly({


    n1<-plot_ly(usvltdyearstore1,labels = ~Month,values = ~TOTAL, type = 'pie',textinfo = "none")%>%add_pie(hole = 0.6)

})  
})

任何帮助将不胜感激

0 个答案:

没有答案