There is a similar question mentioned here, however, it doesn't solve my problem. A trivial c3
script fails to load data when using .toString()
method on var dates = ["2015-03-07", "2015-03-09"]
data: {
x: 'x',
xFormat: '%Y-%m-%d', // 'xFormat' can be used as custom format of 'x'
columns: [
['x', dates.toString()],
['data1', 30, 200, 100, 400, 150, 250],
['data2', 130, 340, 200, 500, 250, 350]
]
},
axis: {
x: {
type: 'timeseries',
tick: {
format: '%Y-%m-%d'
}
}
}
Am I missing something here? The error is as follows
Failed to parse x '2015-03-07,2015-03-09' to Date object