c3js / c3js/c3

Wrong x-values for year-week timeseries chart for some "singular" years

Open
#2,676 2 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

* **C3 version**: 0.7.4
* **D3 version**: 5.8.2
* **Browser**: Google Chrome 76.0.3809.100 (Official Build) (64-bit)
* **OS**: macOS, 10.13.6

Expected behavior:
Screen Shot 2019-08-09 at 11 05 13 AM

The same chart but the year is changed to 2018:
Screen Shot 2019-08-09 at 11 05 53 AM
As one can see the data points moved one week earlier on the chart. There're other "singular" years when this happens: 2007, 2024, 2029, 2035, ...

This is also seen on an older version of C3: 0.4.14

The code used (for convenience):

```javascript
var chart = c3.generate({
data: {
x: 'x',
xFormat: '%Y-%W',
columns: [
['x', '2018-2', '2018-3', '2018-4'],
['data1', 1, 2, 3],
]
},
axis: {
x: {
type: 'timeseries',
tick: {
format: '%Y-%W'
}
}
}
});
```

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.