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

Passing ids to .select API seems to make partial string matches #2138

Open
nbdavies opened this issue Aug 11, 2017 · 1 comment
Open

Passing ids to .select API seems to make partial string matches #2138

nbdavies opened this issue Aug 11, 2017 · 1 comment

Comments

@nbdavies
Copy link
Contributor

If you're columns are named things like "animals" and "non-animals", then you may run into problems when you call:

graph.select('non-animals')

This will select the 'animals' data points as well.

It seems arbitrarily limiting to require that column names not contain one another.

@nbdavies
Copy link
Contributor Author

nbdavies commented Aug 11, 2017

It occurs to me that wrapping the single id in an array probably avoids the issue:

graph.select(['non-animals'])

In c3_chart_fn.select found within api.selection.js, indexOf is expected to be doing array matching, but could accidentally be doing string matching as well:

isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,

Same applies for unselect().

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