简体   繁体   中英

HighCarts Tooltip position relative to mouse

I am using highcharts to create graphics in my website, however this tooltip covers my bars, Is there a way to tell the tooltip todisplay on top of the bar instead that 'ON' it?

here is what I am seeing:

在此处输入图片说明

There are many s question around tool-tip positioning on StackOverflow ,The way I used in my chart was to show tooltip left or right on hover of column using positioner.

 tooltip: {
   positioner: function(labelWidth, labelHeight, point) {         
                         var tooltipX, tooltipY;
                            if (point.plotX + labelWidth > this.chart.plotWidth) {
                                tooltipX = point.plotX + this.chart.plotLeft - labelWidth - 40;
                            } else {
                                tooltipX = point.plotX + this.chart.plotLeft + 40;
                            }
                            tooltipY = point.plotY + this.chart.plotTop - 20;
                            return {
                                x: tooltipX,
                                y: tooltipY
                            };       
                    } }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM