I have an api giving me back multiple arrays I have to place on a c3 line chart. I seem to be able to plot on just fine, but if I start to pass in multiples it starts having a fit. I've done some searching, but from what I've seen mine needs to be more dynamic than calling out specific variable names in the data because I don't know how many I will have at any given time.
My code kind of looks like this
array1 = [];
array2 = [];
array 3 = [];
Data = ?;
c3.generate({
bindto: '.timeline',
data:{
columns: [
Data,
],
axes: {
data2: 'x' // ADD
}
},
axis: {
y: {
label: { // ADD
text: 'Waiting',
position: 'outer-middle'
}
},
x: {
type: 'category',
categories: hour,
show: true, // ADD
label: { // ADD
text: '',
position: 'outer-center'
}
}
}
});
I've seen around to do something like this
columns: [
Data1,
Data2,
Data3
],
Is there any way I can put those arrays into one variable to pass into the c3 graph? I've tried making an array of arrays and passing that in. I've also tried putting them into an object, but that just blew it up too. Any help would be appreciated!