c3js / c3js/c3

Selection issue with overlapping series

Open
#1,617 3 comments 0 reactions 0 assignees View on GitHub
C-feature-request
Dominant language
JavaScript
Stars
9.3k
Forks
1.4k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

If you display two series as:
- data1 is a bar, selectable
- data2 is a line, not selectable

When you hover a point data2 that overlaps data1 you see the point as being selectable (you have the tooltip of data2 and the 'pointer' cursor).

If you click that point, you have both the click event on data1 and data2.

Apparently #608 was not really fixed.

See: https://jsfiddle.net/mcd6ucge/24/

``` javascript
var chart = c3.generate({
data: {
columns: [
['data1', 100, 100],
['data2', 50, 150]
],
selection: {
enabled: true,
isselectable: function(d) {
return d.id === 'data1';
}
},
onclick: function(d) {
console.log('clicked', d.id);
},
type: 'bar',
types: {
data2: 'line',
}
},
tooltip: {
grouped: false
}
});

```

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.