masayuki0812/c3 — pull request #833 by ku (2014-12-17 00:24:34+00:00)
Title: Introduce tooltip.position callback function

Added a callback function to control the position of the tooltip programmatically to tooltip configuration.
`circle` element is given if `grouped` option is false and `region` element is given if it's true.

This callback function allows to show tooltip on the top of the data points like this.

with following configuration.
```
tooltip: {
grouped: false,
position: function (data, width, height, element) {
var chartOffsetX = document.querySelector("#chart").getBoundingClientRect().left;
var graphOffsetX = document.querySelector("#chart g.c3-axis-y").getBoundingClientRect().right;
var tooltipWidth = document.getElementById('tooltip').parentNode.clientWidth;
var x = (parseInt(element.getAttribute('cx')) ) + graphOffsetX - chartOffsetX - Math.floor(tooltipWidth/2);
var y = element.getAttribute('cy');
var y = y - height - 14;
return {top: y, left: x}
},
contents: function (d, defaultTitleFormat, defaultValueFormat, color) {
d = Math.floor(d[0].value)
return '

' + d + ' wows

'
}
}
```