question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding additional support for events

See original GitHub issue

Gday

I’ve been having a play with fitting out chart.js with some additional events, for example when a tooltip opens. I’ve got this working using a simple customevent however I wouldn’t say Im a big fan of this approach at the moment.

Currently someone would have to do something like below which is a bit clunky

		document.getElementById("canvas").addEventListener('tooltipOpened', {
                    console.log(e, e.detail);
               }, false);

I generally work with mapping libraries like leaflet.js which I think has a really neat way of handling events. They instead do something like

map.on('click', function(e) {
    alert(e.latlng);
});

Would you be supportive if I attempted to come up with something of an approach to eventing? Do you have any ideas on how you’d like to see this implemented?

Cheers Rowan

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rowanwinscommented, Feb 21, 2017

Gday @simonbrunel & @etimberg

So I’ve taken a first stab at a very simplistic event plugin.

There is also a demo available using the new tooltip events I have a pull request for, just open the console and you’ll see events being fired.

It’s very simple but I think it’s makes for a some quite usable events rather than jamming everything in in the initialisation of the chart.

Anyway needs lots of tidying up but I thought I’d check in first to make sure it’s heading in the right direction.

Cheers

0reactions
etimbergcommented, Mar 6, 2021

Closing since there was a plugin created to do this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add events - Trumba Help
This topic covers the basic methods for adding events to your Trumba® ... Adding a single event; Adding events from one calendar to...
Read more >
AddEvent.com - Add to Calendar and event tools for websites ...
Add to Calendar and event tools for websites and newsletters. Event with RSVP. Use in email campaigns, MailChimp, Marketo. Used by Google, Microsoft, ......
Read more >
Use the Events web part - Microsoft Support
Add an event · Click Add event. · Give your event a name at the top of the page. · Choose date and...
Read more >
Add attachments to your events - Google Calendar Help
If you create a new event, click More options. At the bottom, in the description box, click Add attachment Attach . Choose a...
Read more >
Adding Additional Events | Everflow Help Center
To add an Additional Event, first navigate from the dashboard to Offers - Manage. From there you can select an offer by clicking...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found