score:2

Accepted answer

i don't see anything in the api that allows you to "turn on" the tooltip for renderer created objects. in the link you provided, they create points close to the renderer objects, and then the mouseover of the object passes that point.

you can follow that pattern (mapping points to the renderer objects):

function some(renderer) {
    renderer.rect(10, 10, 100, 100, 1).attr({
        fill: 'red'
     }).add().on('mouseover', function () {
                var chart = highcharts.charts[0];
                var point = chart.series[0].points[0];
                chart.tooltip.refresh(point);
        })
            .on('mouseout', function () {
                var chart = highcharts.charts[0];
                chart.tooltip.hide();
        });
} 

see fiddle here.

or you could manipulate the tooltip even more directly:

function some(renderer) {
    renderer.rect(10, 10, 100, 100, 1).attr({
        fill: 'red'
    }).add().on('mousemove', function(e) {    
        highcharts.charts[0].tooltip.move(e.pagex,e.pagey); // follow the mouse       
    }).on('mouseout', function(e) {
        highcharts.charts[0].tooltip.hide(); // off the rect, hide it
    }).on('mouseover', function(e) {
        var tooltip = highcharts.charts[0].tooltip;
        cleartimeout(tooltip.hidetimer); // if it was in the process of hiding, cancel
        tooltip.ishidden = false; // mark it as shown
        tooltip.label.attr({
                text: 'hi mom!' // add a label
        });
        tooltip.label.attr('opacity', 1).show(); // show it
    });
}

see updated fiddle here.


Related Query

More Query from same tag