c3js / c3js/c3

hiding column after load {..., unload: true} blanks bar chart

Open
#2,220 1 comment 0 reactions 0 assignees View on GitHub
C-bug
Dominant language
JavaScript
Stars
9.3k
Forks
1.4k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

* **C3 version**: 0.4.18
* **D3 version**: 3.5.17
* **Browser**: Chrome 62
* **OS**: Win 7 64-bit

Similar issue to #1127 , except here I unload in the load function, and any hide/show/toggle operation _afterwards_ blanks the chart

https://jsfiddle.net/0zem6duy/1/

```
var chart = c3.generate({
bindto: "#chart",
data: {
columns: [
['data1', -30, 200, 200, 400, -150, 250],
['data2', 130, 100, -100, 200, -150, 50],
],
type: 'bar',
},
grid: {
y: {
lines: [{value:0}]
}
}
});

setTimeout(function () {
chart.load ({
columns: [
['data1', -320, 200, 200, 400, -150, 250],
['data3', 130, 100, -100, 200, -150, 50],
],
unload: true
});
chart.hide(['data1']);
}, 1000);
```

If I move the hide operation slightly later on, it works, so it looks like another timing/transition issue

https://jsfiddle.net/w3xku9c2/1/

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.