-
Notifications
You must be signed in to change notification settings - Fork 100
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
add ability to use listeners #39
Conversation
Some sample code that uses this:
So not only can we add listeners, but we can also use the "chart" variable that's only available within the per-chart script, allowing us to use multiple charts on one page and be able to add listeners for each of them. In my own code, I also pass an ID identifying which chart it is to the callback, but this example gets the point across... |
+1 |
Happy to merge this in. But I am a little sad that it's not tested. =) Let me know if you have time to get some tests in, else I'll merge it anyway and add in the tests in my free time. Thank you! |
I too was a little sad when you pointed that out. Spec added. :-) |
Hey there, I this works really easy. Just add one line and there is an event-listener! :) Fonteijne |
@fonteijne refer to this reply for a sample usage: #36 (comment) |
You are right about the lack of documentation. Sorry about that. I've raised a feature request fro it over on the docs repo. Will get to it soon. Thank you. |
@kandadaboggu Thank you for the reference. Still struggling, but getting further. @winston Thank you for the feature request. When I got it all figured out, maybe I can find the time to write a concept documentation for it. I'll keep you posted. |
Adds the ability to add listeners to charts. I realize you said this in the readme file:
This totally makes sense; however, there isn't an easy way to "wire up" these javascript listeners when using this gem. The attached change is intended to be a generic way to attach callbacks to these charts, without (IMHO) violating the spirit of what you're talking about in the readme...
ref issue #38