Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

[ R ] Plotly pie chart with only one value not rendering?

Hey there,
still pretty new to R and plotly, so please forgive me in case this is an obvious issue:

To me it seems like plotly does not display pie charts from R with only one value?

plot_ly(type="pie", labels= c("a","b"), values=c(1,2))
This seems to works fine!

plot_ly(type="pie", labels= c("a"), values=c(1))
However with only one value, plotly is not rendering anything, i.e. not showing the 100% pie chart it is supposed to be.

I am trying to embed plotly into my R Shiny web deshboard and I am thankful for any advice :slightly_smiling:

Cheers, Zeba

Strange it should work, I tried with plotly.js

This was a bug that was recently addressed and the fix isn’t on CRAN yet. You can download the latest development version (with the fix) with:
# install.packages("devtools") devtools::install_github("ropensci/plotly")

Hey chelsea, thanks a lot for the tip!