简体   繁体   English

HighCarts工具提示相对于鼠标的位置

[英]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? 我正在使用highcharts在网站中创建图形,但是此工具提示涵盖了我的栏,是否可以告诉工具提示在栏顶部显示而不是“打开”呢?

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. 关于StackOverflow上的工具提示定位有很多问题,我在图表中使用的方式是使用定位器在列悬停时向左或向右显示工具提示。

 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
                            };       
                    } }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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