<div class="chart"></div>
<div class="chart2"></div>
var data = [{"name": "Class", A: 5, B: 20, C: 25, D: 20, E: 30}]
var group = ["A","B","C","D","E"]
var chart = c3.generate({
bindto: '.chart',
data: {
json: data,
keys: {
x: 'name',
value: group
},
type: 'bar',
order: null,
groups: [ group ],
axes: {
A: 'y',
B: 'y',
C: 'y',
D: 'y',
E: 'y'
}
},
size: { width: 160, height: 80},
color: { pattern: ['#f00', '#ffa500', '#ff0', '#b0c4de', '#00ced1'] },
axis: {
rotated: true,
x: {
type: 'category',
show: false
},
y:{
max: 100,
show: false
}
},
legend: { show: false }
});
var data2 = [{"name": "Class", A: 10, B: 15, C: 20, D: 35, E: 20}]
var chart = c3.generate({
bindto: '.chart2',
data: {
json: data2,
keys: {
x: 'name',
value: group
},
type: 'bar',
order: null,
groups: [ group ],
axes: {
A: 'y',
B: 'y',
C: 'y',
D: 'y',
E: 'y'
}
},
size: { width: 160, height: 80},
color: { pattern: ['#f00', '#ffa500', '#ff0', '#b0c4de', '#00ced1'] },
axis: {
rotated: true,
x: {
type: 'category',
show: false
},
y:{
max: 100,
show: false
}
},
legend: { show: false }
});