在缩放或调整大小时/之后如何移动HighStock克隆的工具提示

问题描述

我知道如何克隆HighStock工具提示并使其可见。只要图表的几何形状是静态的就可以。

但是,缩放/缩放/调整图表大小时,静态克隆的工具提示不再与图表一致。如何更新其位置?我猜想在xAxis.events.afterSetExtremes函数的事件处理程序中,但是现在我被困住了。

提琴:http://jsfiddle.net/jakobvinther/xhLtr2cg/

$(function () {
    cloneToolTip = null;
    
    chart = new Highcharts.stockChart('container',{
        chart: {
           renderTo: 'container',},title: {
            text: 'Click on the highlighted point to clone the tooltip.<br>Then zoom or resize. How to update the cloned tooltip position?'
        },plotOptions: {
            series: {
                point: {
                    events: {
                        click: function() { 
                            if (cloneToolTip)
                            { 
                               chart.container.firstChild.removeChild(cloneToolTip);
                            }
                            cloneToolTip = chart.tooltip.label.element.cloneNode(true);
                            chart.container.firstChild.appendChild(cloneToolTip);
                        }
                    }
                }
            },xAxis:{
                events: {
                    afterSetExtremes: function() {
                        // ***** probably update the cloneToolTip position here *****
                   }
                }
            }
        },series: [{
            data: [1,4,3,2,1]  
        }]
    });
});

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)