Highcharts工具提示刷新无法正常工作

时间:2017-07-19 16:46:47

标签: charts highcharts

当用户将鼠标悬停在任何一个图表上时,我试图在多个图表中显示工具提示。

series: {
    point: {
       events: {
          mouseOver: function() {
              syncTooltip(this.series.chart.container, this.x);
          }
       }
    }
}

function syncTooltip(container, p) {

    _.each(totalCharts, (chartType) => {
        let chartContainer = $('#'+chartType);
        let chart = chartContainer.highcharts();
        if (chart && chart.tooltip && container.id != chart.container.id) {
            //I am fetching all points in chart.series whose 'x' value matches with the function parameter 'p'
            var points = process(chart.series);

            if(points.length > 0) {
               chart.tooltip.refresh(points);
            }
        }
    });

}

点数组正在填充。但是,图表工具提示未正确显示。即使图表中突出显示的点也显示错误。

enter image description here

在上图中,我为每个数据点添加了标签(x和y坐标用空格分隔)。 在第二个图表中,第三个点突出显示,而第二个点应突出显示与第一个图表同步

0 个答案:

没有答案
相关问题