c3js / c3js/c3

Broken tooltip when loading data with different length

Open
#1,495 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

May be related to issue #1433.

I first create a series with a few values. Then I load additionnal data in a new series ; it does not have the same number of elements, and the first element is not the same as the first series' one.

The tooltip is broken : it does not show the values the pointer is on.

See the code below or in the [JSFiddle](http://jsfiddle.net/fa0q40e1/).

``` javascript
var chart = c3.generate({
data: {
json: [
{ x: 3, data1: 150 },
{ x: 4, data1: 100 },
{ x: 5, data1: 200 },
{ x: 6, data1: 150 },
{ x: 7, data1: 300 },
{ x: 8, data1: 200 }
],
keys: {
x: 'x',
value: ['data1']
}
}
});

chart.load({
json: [
{ x: 5, data2: 250 },
{ x: 6, data2: 300 },
{ x: 7, data2: 200 },
],
keys: {
x: 'x',
value: ['data2']
},
})
```

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.