Currently, I am utilizing c3js to create a chart using row data and I am interested in implementing specific colors.
var chart = c3.generate({
data: {
x:'x',
rows: [
['x','Winter 2007-2008','Winter 2008-2009','Winter 2009-2010'],
['2013-01-01',12,30,3],
['2013-01-02',123,200,22],
['2013-01-03',21,100,54],
['2013-01-04',32,400,23],
['2013-01-05',12,150,12],
['2013-01-06',34,250,15]
],
},
axis: {
x: {
type: 'timeseries',
tick: {
format: '%Y-%m-%d'
}
}
}
});
Everything seems to be working well so far, however, I would like to assign custom colors to each line.
When dealing with column data, achieving this is quite straightforward. You can refer to this example:
data: {
x:'x',
columns:[[]]
},
color: {
pattern: ['#1f77b4', '#aec7e8', '#ff7f0e']
}
Is it possible to accomplish the same with row-oriented data?