I am trying to create a C3 bar chat. Need to pass the JSON dynamically.
JSON: JSONdata
{ "applicationName": "app1", "frequency": 1 }, { "applicationName": "app2", "frequency": 54 }, { "applicationName": "app3", "frequency": 3 }
I have the below code and it does not work. Tried using JSONdata.stringify() too.
var chart = c3.generate({
data: {
type: 'bar',
json: [
JSONdata
],
keys: {
x: 'applicationName',
value: ['frequency']
}
},
axis: {
x: {
type: 'category'
}
},
bar: {
width: {
ratio: 0.5
}
}
});