I use c3 to create simple graphs. I want to get data from a Json file and fill it in to create my Line-Graph.
My Y values โโshould be ("Labels"), and my X values โโshould be ("Dates"). So what my code looks like:
var chart = c3.generate({
bindto: '#chart',
data: {
xFormat: '%Y-%m-%dT%H:%M:%S',
json: {
times:datas,
data: labels
}
}
});
My "data" (array):
"2014-01-01T10:10:10"
"2014-02-01T10:10:10"
"2014-03-01T10:10:10"
"2014-04-01T10:10:10"
"2014-05-01T10:10:10"
...
And my shortcuts:
1234.433
2234.431
1231.546
8965.354
....
How can I set now, my data in X-Axis and labels in Y?
source
share