繁体   English   中英

Highcharts - 多个yAxis,每个都有自己的工具提示

[英]Highcharts - multiple yAxis each with its own tooltip

这可能吗?

十字准线多个yAxis线多个工具提示

我已经玩过tooltip.sharedtooltip.crosshairs但我无法得到类似的东西。

编辑:像Wunderground的天气预报图表是完美的(尝试“鼠标悬停”图表)

在同步高图中使用tooltip.positioner可能会导致所需的行为。

tooltip: {
      positioner: function(labelWidth, labelHeight, point) {
        var tooltipX, tooltipY;
        tooltipX = point.plotX + this.chart.plotLeft + 20;
        tooltipY = point.plotY + this.chart.plotTop - 20;
        return {
          x: tooltipX,
          y: tooltipY
        };
      }
    }

小提琴演示修改同步图表演示

更新工具提示隐藏在最右侧的修复

tooltip: {
      positioner: function(labelWidth, labelHeight, point) {
        var tooltipX, tooltipY;
        if (point.plotX > 340) {
          tooltipX = point.plotX + this.chart.plotLeft - 150;
        } else {
          tooltipX = point.plotX + this.chart.plotLeft + 20;
        }
        tooltipY = point.plotY + this.chart.plotTop - 20;
        console.log(tooltipX);
        return {
          x: tooltipX,
          y: tooltipY
        };
      }
    }

固定小提琴

暂无
暂无

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

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