jcheng5 / bubbles

d3 Bubble Chart for R
MIT License
57 stars 23 forks source link

Formatting labels by string wrapping and changing text size #9

Open faithmusili opened 6 years ago

faithmusili commented 6 years ago

How can i wrap label text to avoid overlapping with the adjacent one whereby my labels are long but must be used as they are ? str_wrap and stri_wrap ain't doing the magic. is it possible to change my label size?

See reproducible code below:

library(bubbles)

dummy data

Practice<-c("Adherence to recommended spacing", "Conservation farming using ridges","Use of improved seeds","Irrigation","Use of pesticides") Rank<-c("5","4","1","3","2") data<-data.frame(Practice,Rank)

bubble chart

bubbles(value=data$Rank,label =data$Practice ,key = data$Practice, color = c("red","plum","green","coral","deepskyblue"), textColor = "black",width="100%")

Output:

screenshot 2018-01-18 14 55 39