在Plotly中旋转hover-info

时间:2016-03-24 21:31:10

标签: r plotly

我当前图表的悬停信息略有旋转(见下图)。也就是说,当我将鼠标悬停在条形图上时,悬停文本会从水平方向旋转约60度(例如,请参见图像中的第二个条形图)。如何将旋转设置为0?

# sample data
tbl = data.frame(list_id = c(1,2,3,4,5,1,2,3,4,5,1,2,3,4,5), 
             main_count = c(1,2,3,4,1,2,3,4,1,2,3,4,1,2,3),
             total = c(23,34,66,22,66,88,55,44,22,11,33,55,43,22,55))

plot_ly(tbl, type = "bar",
  y = main_count, x = total, group = list_id, orientation = "h") %>%
  layout(xaxis = list(title = ""), barmode = "stack")

stacked bar chart with rotated labels

1 个答案:

答案 0 :(得分:0)

如果您下载情节(我使用plotly.js),您可以更改度数:YANGLE:60,但是当它们接近时,如果您想要将hovertext打开,它将相互覆盖上面或水平