javascript - Highcharts 列工具提示 - 始终位于顶部 + 适合容器

标签 javascript jquery svg highcharts tooltip

我有一个带有工具提示的 Highcharts 。这就是我每次想要渲染工具提示的方式。

good case

当tootlip不适合svg容器时,highcharts会像这样交换工具提示的位置。

bad case

我知道如何解决这个问题,但是当我这样做时。

positioner: function(boxWidth, boxHeight, point) {
    return {
        x: point.plotX,
        y: point.plotY - boxHeight
    };
},

工具提示正确地始终位于顶部,但溢出到右侧 (image_1)。我希望工具提示始终位于顶部+从侧面适合容器。 (image_2)

enter image description here

enter image description here

有什么简单的方法可以实现这一点吗?

谢谢(http://jsfiddle.net/4xomw3aj/)

最佳答案

好吧,我刚刚发现如何“不交换”。在 Tooltip.getPosition() 中

firstDimension = function (dim, outerSize, innerSize, point) {
    ret[dim] = point - distance - innerSize;
},

关于javascript - Highcharts 列工具提示 - 始终位于顶部 + 适合容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31584347/

相关文章:

javascript - 滚动时缩小导航或调整大小

javascript - 多个元素和多个事件的 jQuery 相同函数

html - 绘制具有斜边的双曲面元素

javascript - 如何区分 detail_page 和 list_page?

javascript - Node JS 安全摄像头运动检测

javascript - 如何像谷歌一样覆盖文档中的退格键功能

html - 具有笔划宽度的 svg 路径内的相邻线

javascript - javascript函数的typeof是在声明函数之前定义的吗?

javascript - 有什么理由在构造函数中手动设置 `return` 吗?