如何在R Shiny中操纵绘图的交互式工具栏框?

时间:2018-12-20 10:00:44

标签: r shiny r-plotly

如何操作由plotly程序包生成的图的工具栏(不确定名称是否正确?!请参见pic。)有光泽吗 那是我在server端的代码:

 plot_ly(pl.d, x = ~x, y = ~y1, type = 'bar', name = colnames(dataset())[2], marker = list(color = "#26478A"),
            height=800) %>%
      add_trace(y = ~y2, name = colnames(dataset())[3], marker = list(color = "#FF6600")) %>%
      add_trace(y = ~y3, name = colnames(dataset())[4], marker = list(color = "#7E182F")) %>%
      layout("title" = colnames(d.plot)[1],
             xaxis = list(title = "", tickangle = 65,tickfont  = list(family= "Arial",size = 14),
                          margin = m
                          ), 
             yaxis = list(title = "",ticksuffix = "%"),
             barmode = 'group'
            # autosize = F, width = 500, height = 500,,margin = m
             ) 

1 个答案:

答案 0 :(得分:0)

不确定要在工具栏中修改的内容是什么,但是如果要带走一些物品,可以使用config(modeBarButtonsToRemove = list("lasso2d","hoverClosestCartesian", "hoverCompareCartesian","select2d")),至少在ggplotly中是这样,但是我敢肯定,您可以使用它还具有plotly功能。