r - 如何在 R Shiny 中操作绘图的交互式工具栏框?
问题描述
如何操作由闪亮包生成的绘图的工具栏(我不确定名称是否正确?!请参阅.)?那是我的代码:plotly
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
)
解决方案
不确定你想在工具栏中修改什么,但如果你想拿走一些项目,你可以使用config(modeBarButtonsToRemove = list("lasso2d","hoverClosestCartesian", "hoverCompareCartesian","select2d"))
至少对于 ggplotly 是这种情况,但我很确定你也可以将它与 plotly 函数一起使用。
推荐阅读
- java - 更改 JOptionPane showMessageDialog Boxes 的字体
- c++ - 为什么转换构造函数需要在执行显式转换时声明复制构造函数?
- flutter - Flutter 中的搜索栏实现
- javascript - 函数循环两次
- python - 如何在文件Python中获取括号中的内容
- ios - SwiftUI LazyVGrid 如何调整列的大小以使用显示其所有文本所需的最大宽度
- flyway - 使用 http 代理的 flyway 配置
- redirect - Nginx Ingress - 在 Minikube 与 GKE 上将 WWW 重定向到非 WWW
- javascript - 使用泛型定义函数
- python - 从 .txt 文件中加入 python 中的 2 行(第 148 行和第 149 行)