c3js / c3js/c3

Stacked area chart: stacking on the same series

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

I'm trying to accomplish stacking two series upon a single serie in c3js. What I mean is that given I have 3 series {`data1`, `data2`, `data3`} I want to stack both `data2` and `data3` on `data1`. That means that `data2` and `data3` overlap, but are both on top of `data1`. I hope that is sufficiently clear.

The closest I have come is to specify the groups as follows:

```
"groups": [
["data1", "data2"],
["data1", "data3"]
]
```

That works... almost. I have a JSFidle here: http://jsfiddle.net/6xpx8s7w/2/

As you can see the stacking isn't correctly when opening the JSFiddle, however if you deselect (by clicking on the legend) one of the series, it works correctly.

So this is wrong:
![image](https://cloud.githubusercontent.com/assets/301092/12511763/2167ac2c-c114-11e5-81b0-a08ec5409305.png)

But deselecting `data1` for example gives the correct output:
![image](https://cloud.githubusercontent.com/assets/301092/12511775/3937b162-c114-11e5-8d96-d3e9096bc1f7.png)

Also deselecting one of `data2` or `data2` works:
![image](https://cloud.githubusercontent.com/assets/301092/12511786/4d1c8806-c114-11e5-82bc-6be4a1adde56.png)

Is this supposed to be possible? Is it a bug?

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.