In this case I would like to show 180 instead of 0 on tooltip title. I know that it can be customized like it is done in c3 official documentation. But I don't find the way to get the total per column.
Just write your own tooltip contents function
tooltip: {
contents: function (d, defaultTitleFormat, defaultValueFormat, color) {
var sum = 0;
d.forEach(function (e) {
sum += e.value
})
defaultTitleFormat = function () {
return sum
};
return c3.chart.internal.fn.getTooltipContent.apply(this, arguments);
}
}
Fiddle - http://jsfiddle.net/x0b3w32e/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With