eclipsesource / eclipsesource/tabris-js

Support attaching events to canvas with addEventListener(eventType,method)

Open
#61 2 comments 1 reaction 1 assignee Claimed by @ralfstx View on GitHub
Dominant language
JavaScript
Stars
1.4k
Forks
171
PR merge metrics
No merged PRs in 30d

Description

chart.js tries to attach listeners to the canvas like this:

```
addEvent = helpers.addEvent = function(node,eventType,method){
if (node.addEventListener){
node.addEventListener(eventType,method);
} else if (node.attachEvent){
node.attachEvent("on"+eventType, method);
} else {
node["on"+eventType] = method;
}
```

`node` is the canvas of our CanvasContext (chartInstance.chart.canvas)
`eventType` can be passed by the configuration of the chart, so we could use "Selection"

There might be better ways to support chart.js than using addEventListeners ...
Maybe it would make sense to support an API like this for all widgets?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.