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

Highlighted bar in sync between bar charts of same dimension #681

Open
dimirc opened this issue Aug 24, 2014 · 1 comment
Open

Highlighted bar in sync between bar charts of same dimension #681

dimirc opened this issue Aug 24, 2014 · 1 comment
Milestone

Comments

@dimirc
Copy link

dimirc commented Aug 24, 2014

I have 2 bar charts that use the same dimension (by month). One showing quantity of orders and another the sum of the total of the orders.

Each bar represents a month, so I wanted that if I press one month in any of the charts, that the other chart also presents the same highlighted month too. (in sync)

Finally checking the code and reading some suggestions from the user group question I was able to do it.

I'd like to help on trying to put this feature/functionality in the core instead. Maybe we could have a new method on base-mixin so that charts that are part of same syncGroup to pass the filter to the others charts from same group and reflect correctly the highlighted element?

@gordonwoodhull
Copy link
Contributor

Thanks, this would be great!

To make it a little more general, why not make a chartGroup object which allows enumerating the charts in it. (There was another recent request for legend groups, and this would help there too.)

Then, as you say, have a syncGroup property on the chart, which takes a chartGroup and adds itself to it, as well as holding a reference to it.

Since the specifics will likely be different for other kinds of charts, you might want to start simple and implement this for bar charts only.

Please also write some basic tests and submit a PR. I'll aim to include this in 2.1. Thanks again!

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

No branches or pull requests

2 participants