c3js / c3js/c3

Tooltip with grid lines X

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

Description

Hi, I'll tried to review the documentation about how show the tooltip (custom) but, it's not possible. the code that I have is..

Note: I'm using REACT to work..

var $$ = chart.internal;
var dataT;

```
function mouseover(obj,d) {
var updated = $$.updateAngle(d), arcData, selectedData;
arcData = $$.convertToArcData(updated),
selectedData = [arcData];
console.log("mouseover event: "+selectedData);
$$.showTooltip(selectedData, obj);

return ;
}

function mousemove() {
return ;
}

function mouseout() {
return ;
}

chart.internal.main.selectAll('.' + c3.chart.internal.fn.CLASS.eventRect).on('mouseover', function (d) {
$$.main.selectAll('.' + c3.chart.internal.fn.CLASS.line).each(function (d) {
//console.log("mouseover Obj :"+this);
if ($$.isWithinShape(this, d)) {
dataT = d.index;
// Show tooltip
dataT = $$.filterTargetsToShow($$.data.targets).map(function (t) {
return $$.addName($$.getValueOnIndex(t.values, d.index));
});

mouseover(this,d);
console.log("mouseover pageY:"+$$.d3.event.pageY+" pageX:"+$$.d3.event.
}); //mouseover Event
```

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.