在Plotly饼图中添加图像徽标

时间:2016-09-14 12:31:58

标签: r shiny plotly

我正在尝试使用Plotly在环形图表的背景中添加图像,但不知何故图像不会显示。 剪切的代码如下所示

plot.df <- x %>%
group_by(key) %>%
summarize(count = value)
    p <- plot_ly(plot.df, labels = key, values = count, type = "pie", hole = 0.6, textposition='null', showlegend = F,
                 marker=list(colors=c("rgb(198, 248, 253)", "skyblue"))) %>%
         layout(title = "Donut charts using Plotly",images = list(
           list(source = "/leaf-green.png",
                xref = "x",
                yref = "y",
                x= 1,
                y= 1,
                sizex = 1,
                sizey = 1,
                opacity = 0.8,)
         ))
    p

提前致谢。

0 个答案:

没有答案