Loading CSV data and having a time series (xFormat: '%Y-%m-%d')
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.4k
- Avg merge
- 6d 16h
- Merged PRs (30d)
- 1
Description
Can you use timeseries and also data from csv? I have lots of data so I'm getting it from csv (url: 'data.csv') but I also want to use a time series with 12 hours interval and the total interval is 5 days. I tried many things but it doesn't work. It seems like I either have to use data from the same script (not csv) in order to use timeseries. I'm able to load the CSV, but once I add the timeseries, it does not work anymore. I'm also able to load a timeseries but only if the data is from the columns and not from a file load. I need to work both, timeseries + data from CSV file.
var chart = c3.generate({
bindto: '#chart',
data: {
url: '../data_testing.csv',
x: 'x',
xFormat: '%Y-%m-%d',
columns: [
['x', '2016-8-10', '2016-8-10', '2016-8-10', '2016-8-10', '2016-8-10', '2016-8-10']
],
type: 'line'
},
axis: {
x: {
type: 'timeseries',
localtime: false,
tick: {
culling: true,
fit: true,
culling: {
max: window.innerWidth > 700 ? 8 : 5
},
format: '%Y-%m-%d' // %H:%M:%S
}
},
y: {
max: 55,
min: 6
}
}
});
require(["d3", "c3"], function (d3, c3) {
c3.generate({
});
});
* **C3 version**: 0.6.8
* **D3 version**: 5.7.0
* **Browser**: Chrome
* **OS**: Mac OSX
Contributor guide
Assessment
This issue has not been assessed yet.