Open ghost opened 8 years ago
I believe it it possible.
Here's a tutorial about adding a custom rollover: http://rpackages.ianhowson.com/cran/metricsgraphics/man/mjs_add_mouseover.html
This issue is relevant if developing a Shiny app: https://github.com/hrbrmstr/metricsgraphics/issues/35
In short, using mjs_add_mouseover is the way to add additional data to the rollovers.
mjs_add_mouseover("function(d, i) {
$('{{ID}} svg .mg-active-datapoint')
.text( 'Disp: ' + d.point.disp + ' | HP: ' + d.point.hp + ' | Model: ' + d.point.model);
I have tried the custom rollover option.
It gives any column that you want to see when you hover over a point, but it only does that - it gives information. It does not establish a link on the variable that you included in the custom function.
Sorry, I misunderstood your request.
You gave the right answer to my question, my question was not clear, I have made some edits.
I like the linked charts and want to link them on a 3rd variable, but have not found a way to do so.
Assume you have the mtcars dataset, x-axis = mpg and you have 2 scatterplots, with y-axis disp and hp respectively. Then the rollover value that I would like to see is the car model, not just x =mpg and y = disp or y = hp.
Is there a possibility to make this link in metricsgraphics?