**3.72 KB**

## Custom interactive CSS/HTML tooltips with ggplot, shiny and R (ggvis like).

Edited-
Hi Pawel,

This is very helpful, and works wonderfully! I am reordering the scatterplot in an ascending order in my ggplot. The tooltip however, does not get rearranged. How can I fix that?

Here is my code:

`losd <- ggplot(lo_sd, aes(x = uid, y = bc, color = color)) + geom_point(aes(x = reorder(lo_sd$uid, lo_sd$bc), y = lo_sd$bc), size=2) + geom_errorbar(aes(ymin = lo_sd$lci, ymax = lo_sd$uci), width=0.00, show_guide = F, size = 1) + geom_hline(yintercept = 0, linetype="solid", color = "#6b5e4f", size=1) + scale_y_continuous(limits = c(-0.65, 0.65)) + scale_x_discrete(limits = lo_sd$uid, labels = lo_sd$cname) + scale_color_discrete(name = "Subject tests") + labs(y = "Effect size (sd)", x = "", title = "") + coord_flip()`

Any thoughts?

Thanks you so much!