c3js / c3js/c3

Pie Chart Behavior

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

There is another way to accomplish this:

``` javascript
var chart = c3.generate({
data: {
columns: [
['data1', 30],
['data2', 120],
['data3', 20],
],
type : 'pie',
onclick: function (d, i) { console.log("onclick", d, i,chart.data.shown()); },
},
legend: {
item: {
onclick: function (id) {chart.toggle(id);if(chart.data.shown().length===0){chart.toggle();}}
}
}
});
```

change the behavior of legend.
thanks

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.