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

Get chart on click event #2

Open
Shane98c opened this issue Apr 28, 2017 · 6 comments
Open

Get chart on click event #2

Shane98c opened this issue Apr 28, 2017 · 6 comments
Assignees
Labels

Comments

@Shane98c
Copy link

Shane98c commented Apr 28, 2017

Still loving this library, thanks again!

Is there any way to attach a click event to a chart? I see that the library is an extension of L.CircleMarker, but adding:

this.charts[i] = new L.minichart(loc, {data: data, type:'polar-area'});
this.charts[i].on("click", (e) => this.onMapClick(e));
this.map.addLayer(this.charts[i]);

Isn't providing me with any event fired.

Thanks!

@FrancoisGuillem
Copy link
Contributor

OK, I will take a look at it. It is a bit strange because "mychart.bindPopup()" works correctly so I don't see why "mychart.on(...)" would not work.

@FrancoisGuillem FrancoisGuillem self-assigned this Apr 28, 2017
@FrancoisGuillem FrancoisGuillem added bug and removed bug labels Apr 28, 2017
@FrancoisGuillem
Copy link
Contributor

So I have done some tests and I cannot reproduce your problem. Could you check you use the last version of the library? (0.2.2)

@Shane98c
Copy link
Author

Shane98c commented May 2, 2017

I'm on 0.2.2 with Leaflet 1.0.3.

@FrancoisGuillem
Copy link
Contributor

Oh OK, the problem appears with leaflet 1.0.X

@FrancoisGuillem
Copy link
Contributor

This should be solved. Could you get the development version (branch develop) and confirm this and #5 are OK now?

@Shane98c
Copy link
Author

Shane98c commented May 4, 2017

Edit: replied to the wrong issue. Click events are working great now!

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

No branches or pull requests

2 participants