I am using C3.js to build a Line graph. In this graph I have to change the circle colors according to the array of colors.
The code of c3 is below:
var chart = c3.generate({
bindto:'#timeline',
colors:['red', 'blue','green','yellow','green','red'],
data: {
x: 'x',
columns: [
['x', '2013-01-01', '2013-01-02', '2013-01-03', '2013-01-04', '2013-01-05', '2013-01-06'],
['data1', 10, 15, 12, 5, 9, 11],
['data2', 15, 12, 10, 8, 4, 12],
]
},
axis: {
x: {
type: 'timeseries',
tick: {
format: '%Y-%m-%d'
},
label: {
text: 'Dates',
position: 'outer-middle'
}
},
y: {
show:true,
label: {
text: 'Count',
position: 'outer-middle'
}
}
}
});
For each data point I want to fill it with the corresponding color from colors
array. I have to use CSS, but I am not sure how to do it inside this generate
function.