c3js / c3js/c3

empty strings and nulls in column names causes data offset

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

Description

When a column name is an empty string or null, looks like it's being skipped, which causes all the data to be shown incorrectly after that (with offset of 1). If column names are not allowed as empty strings or nulls perhaps it would be better to warn / error, since it 'looks' as if the graph is shown correctly, but actually it's not.
Happens on v0.4.10, reproduction code:

```



```

```
var x = {
bindto: "#a",
axis: { x: {type: "category"} },
data: {
columns: [
["x", "2014-04", "2014-05", "2014-06", "a", "2014-08", "2014-09", "2014-10"],
["a", null, null, null, null, null, null, "50"],
["b", "10", "11", "9", "2", "16", "2", "50"],
["c", null, null, "13", "16", "20", "5", "50"]
],
x: "x"
}
};

c3.generate(x);
x.bindto="#b";
x.data.columns[0][4] = "";
c3.generate(x);
```

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.