I am trying to use a variable inside of an Array, I get no Error and its not working any idea?
var hdd_usage = [12,1232113,12];
var test = JSON.stringify(hdd_usage).substr(1,JSON.stringify(hdd_usage).length-2);
console.log(test);
var chart = c3.generate({
data: {
columns: [
['data1', 1831.7,1831.7,],
['data2', test]
],
types: {
data1: 'area',
data2: 'area-spline'
}
}
});
Tested here: http://c3js.org/samples/chart_area.html
Actually the hdd_usage is a json encoded string via php, but thats just for testing now. If you get a fix or a better solution let me know it.
Thanks.