Suppose I have a plotly graph in which I want to show another plot as hover info. Is it possible using plotly or echart4r? If yes, an example would be really appreciated.
Asked
Active
Viewed 318 times
1 Answers
1
It's certainly not a straightforward solution but this should be achievable using Shiny.
Plotly has the event_data
function to allow you to access information about the user's interaction with the plot (such as where they are hovering):
https://rdrr.io/cran/plotly/man/event_data.html
https://plotly-r.com/linking-views-with-shiny.html#shiny-plotly-inputs
You could then tie this to a reactive UI element which contains the plot you are after inside of a tooltip. You will likely need to use a bit of Javascript to move around the tooltip. See example 3 from here for an idea:
https://stackoverflow.com/a/38919892/2947600
Give this a go if you'd like and if you're having a hard time, I might have the time to make a minimal example.

Tim Hargreaves
- 292
- 3
- 11
-
Thanks for the answer. I will give a try with the information you have given and will revert you. – Williams86 Dec 13 '20 at 06:47