0

I've created the following treemap in R using the plotly package:

  type='treemap',
  labels=treelabels,
  parents=treeparents,
  values= c(89675, 181557-89675, 38462, 51213, 3640, 18002, 9171, 7649, 5512, 26774, 6981, 11946),
  textinfo="label+value+percent parent",
  branchvalues = "total",
  domain=list(column=0))

Treemap

First, I want the order of the sections to be switched so that the "Financial cases" section is on the left hand side of the plot, since this is the one I want to emphasize (the "Non-financial" one is less important, so I'd like it on the right). Secondly, I want percentages to show up next to all labels -- not just the smallest layers (i.e. next to "Financial Cases" it should say 49%).

I can't find anything in the plotly documentation that would allow me to fix these issues. Any help would be much appreciated.

  • Could you please share your complete code and data using `dput`? – Quinten Aug 15 '22 at 17:43
  • 1
    It looks like you're new to SO; welcome to the community! If you want great answers quickly, it's best to make your question reproducible. This includes sample data like the output from `dput()` or `reprex::reprex()` and any libraries you are using. Check it out: [making R reproducible questions](https://stackoverflow.com/q/5963269). – Kat Aug 24 '22 at 01:25

0 Answers0