function placeMarkerText(gm, args) {
gm.selectAll('.mg-markers')
.data(args.markers.filter(inRange(args)))
.enter()
.append('text')
.attr('class', function(d) {
return d.textClass || '';
})
.classed('mg-marker-text', true)
.attr('x', xPosition(args))
.attr(
'y',
args.xAxis_position === 'bottom'
? args.top * 0.95
: getBottom(args) + args.buffer
)
.attr('text-anchor', 'middle')
.text(returnLabel)
.each(function(d) {
if (d.click) {
select(this)
.style('cursor', 'pointer')
.on('click', d.click);
}
if (d.mouseover) {
select(this)
.style('cursor', 'pointer')
.on('mouseover', d.mouseover);
}
if (d.mouseout) {
select(this)
.style('cursor', 'pointer')
.on('mouseout', d.mouseout);
}
});
preventHorizontalOverlap(gm.selectAll('.mg-marker-text').nodes(), args);
}