I would like to create a C3 bar chart, but somehow be able to see the attributes associated the data.
So, let's say my chart is defined as below (I'll just say it's survey data):
var chart = c3.generate({
data: {
type: 'bar',
json: [
{ 'response': 'Yes', 'type': 'A', 'total': 1 },
{ 'response': 'No', 'type': 'B', 'total': 2 },
{ 'response': 'Maybe', 'type': 'C', 'total': 3 }
],
keys: {
x: 'response',
value: ['total']
}
},
axis: {
x: {
type: 'category'
}
},
bar: {
width: {
ratio: 0.5
}
}
});
How can I hover over a bar and be able to see the "type" attribute? So, I would know that
And so on. Here is a fiddle with the code I'm starting with: https://jsfiddle.net/oc34gd2n/9/
I'm getting familiar with C3 so I'm not sure if this functionality is easy to implement or what API offers it.