Home > Software engineering >  Plotly R: create dividers in bar plot like Tableau
Plotly R: create dividers in bar plot like Tableau

Time:04-25

I have this dataframe:

df = data.frame(
  Period = c("FY2015", "FY2015", "FY2015", "FY2015", "FY2015", "FY2015", "FY2016", "FY2016", 
              "FY2016", "FY2016", "FY2016", "FY2016"),
  Region = c("Africa", "Asia", "Australia", "Europe", "North America", "South America", 
             "Africa", "Asia", "Australia", "Europe", "North America", "South America"),
  Revenue = c(1.0e 07, 2.0e 07, 7.0e 07, 1.2e 08, 1.5e 08, 6.0e 07, 8.0e 06, 1.6e 07, 5.6e 07, 
              9.6e 07, 1.2e 08, 4.8e 07))

I would like to have a plotly bar plot in divided by Region, just like I did enter image description here

  • Related