Category Axis with a x value of 0 (zero) creates incorrect categories
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.4k
- Avg merge
- 6d 16h
- Merged PRs (30d)
- 1
Description
Using JSON data and axis.x.type: 'category'. I set data.keys.x to 'bin', when a bin is zero, the first category gets goofed up; categories shift over so that the first category gets the label of the second and so on. Finally, the last becomes is given the default category (zero-indexed enumeration).
bad:

good:

full code demonstation:
```
var chart = c3.generate({
data: {
type: 'bar',
json: [
{ "count": 1, "bin": 0}, //change this bin to anything but 0 and everything looks great!
{ "count": 10, "bin": 22},
{ "count": 30, "bin": 33},
{ "count": 40, "bin": 3},
],
keys: {
x: 'bin',
value: ['count'],
}
},
axis: {
x: {
type: 'category' // bug only with category axis
}
}
});
```
Contributor guide
Assessment
This issue has not been assessed yet.