I'm trying to load local csv file and also use a timeseries. I have lots of data so I'm getting it from csv (url: 'data_testing.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 with no luck. It seems like I either have to use data from the same script (not loading a 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 use 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.
C3 version: 0.6.8 - D3 version: 5.7.0 - Browser: Chrome - OS: Mac OSX
var chart = c3.generate({
bindto: '#chart',
data: {
// this only works if I don't use time series
url: '../data_testing.csv',
x: 'x',
// this only works if I'm writing the data and not using local csv file
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({
});
});