Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linked charts #41

Open
ghost opened this issue Jan 13, 2016 · 4 comments
Open

Linked charts #41

ghost opened this issue Jan 13, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 13, 2016

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?

@phillc73
Copy link

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: #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);

@ghost
Copy link
Author

ghost commented Jan 13, 2016

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.

@phillc73
Copy link

Sorry, I misunderstood your request.

@ghost
Copy link
Author

ghost commented Jan 13, 2016

You gave the right answer to my question, my question was not clear, I have made some edits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant