Stacked ggplot percent barchart in shiny

橙三吉。 提交于 2019-12-05 16:33:10
Mike Wise

The error from your paste0 command comes because it is the last line in the reactive, and thus becomes the return value. Just add a statement return(df) or something equivalent and that will fix that problem.

As for the label positioning, the code is working as designed, you will have to calculate the desired positions for the geom_text and use those coordinates explicitly.That will require you summing up the coordinates for each individual brand segment so you know its left and right positions and can calculate the center.

Other answers can be found in here:

How to center stacked percent barchart labels

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!