I believe in this, for what you are going:
var chart = c3.generate({
data:{
json:[
{"key":2000,"value":100},{"key":2001,"value":200},
{"key":2003,"value":300},{"key":2004,"value":400},
{"key":2005,"value":500},{"key":2006,"value":600},
{"key":2007,"value":700}
],
keys:{
x: "key",
value:['value']
}
},
axis: {
x: {
type: "category"
}
}
});
I'm not sure why you will have a key for the data point, it is an array (maybe you want to change the keys and values?), But here is the basic key, a graph of value strings, which I think you are going to.
checkout out this fiddle adapted from Sikandar Tamboli's answer
source
share