簡體   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