Highcharts 工具提示中的URL链接
我在工具提示中有一个url链接,但是,如果工具提示超出图表区域,并且您尝试单击url,则工具提示将消失 有什么解决办法吗Highcharts 工具提示中的URL链接,highcharts,Highcharts,我在工具提示中有一个url链接,但是,如果工具提示超出图表区域,并且您尝试单击url,则工具提示将消失 有什么解决办法吗 谢谢 我发现在这种情况下,最好手动定位工具提示: 这样,不必要的隐藏是可控的 编辑: 如果扩展工具提示原型,则可以操纵X和Y轴 Tooltip.prototype.move = function (x, y, anchorX, anchorY) { var tooltip = this, now = tooltip.now, anim
谢谢 我发现在这种情况下,最好手动定位工具提示: 这样,不必要的隐藏是可控的 编辑: 如果扩展工具提示原型,则可以操纵X和Y轴
Tooltip.prototype.move = function (x, y, anchorX, anchorY) {
var tooltip = this,
now = tooltip.now,
animate = tooltip.options.animation !== false && !tooltip.isHidden;
if(x > ?????)
{
x = x - 50; // or how ever many pixels you want to move it to
}
// get intermediate values for animation
extend(now, {
x: animate ? (2 * now.x + x) / 3 : x,
y: animate ? (now.y + y) / 2 : y,
anchorX: animate ? (2 * now.anchorX + anchorX) / 3 : anchorX,
anchorY: animate ? (now.anchorY + anchorY) / 2 : anchorY
});
// move to the intermediate value
tooltip.label.attr(now);
// run on next tick of the mouse tracker
if (animate && (mathAbs(x - now.x) > 1 || mathAbs(y - now.y) > 1)) {
// never allow two timeouts
clearTimeout(this.tooltipTimeout);
// set the fixed interval ticking for the smooth tooltip
this.tooltipTimeout = setTimeout(function () {
// The interval function may still be running during destroy, so check that the chart is really there before calling.
if (tooltip) {
tooltip.move(x, y, anchorX, anchorY);
}
}, 32);
}
}
谢谢这似乎很接近。有没有办法返回工具提示位置的值?说如果它从未尝试过,但我相信你可以覆盖定位器方法。查看Highcharts源代码。工具提示用于显示点信息。如果你想要这样的东西,我建议你在用户点击该点时显示它,这样你就可以毫无问题地点击工具提示内容。有了完全相同的问题,这就解决了它,因为我只在手机上使用highcharts,如果我点击或点击,这没有任何区别: