Below is the code I'm using to generate a line graph using c3.js. In the variable 'value' I'll get the values to be plotted as comma separated values. I've hard coded the values now. With this code, the graph generated has only one value - '0'.
This code doesn't work :
var name = "Graph Values";
var value = "120,150,120,120,120";
var obj = {
"data1": [value]
}
var chart = c3.generate({
bindto: '#chart1',
data: {
columns: [
[name].concat(obj.data1)
]
}
});
This code works :
var name = "Graph Values";
var value = "120,150,120,120,120";
var obj = {
"data1": [120,150,120,120,120]
}
var chart = c3.generate({
bindto: '#chart1',
data: {
columns: [
[name].concat(obj.data1)
]
}
});