score:0

I believe this what you are going for:

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 would have the key for a data point be an array (perhaps you want to swap the keys and values?), but here is a basic key, value line graph, which is what I think you are going for.

checkout out this fiddle adapted from Sikandar Tamboli's answer

score:5

chart.data('value')[0].values[0].value 

c3 documentation here

check out this fiddle


Related Query

More Query from same tag