2015-10-20 62 views
0

我正在使用區域範圍圖與系列的範圍數據來顯示圖表,但工具提示並不需要任何系列數據,而是需要部分數據顯示在相應的點上。我不確定哪個是正確的。我已經有3個數據串聯顯示圖表。當我爲系列添加5分時,它變成了8個系列分數。我無法獲得動態添加的數據,並且系列中的其他數據混淆了我的數據,我無法訪問添加的確切數據。如何在懸停的Highcharts工具提示上顯示自定義或非系列數據數組?

所以,我想添加點

tooltip: { 
      formatter: function() { 
       var points = this.points, 
        point, 
        pointValue, 
        i = 0, 
        j, z = 0, 
        seriesValueHolder = {}; 
       var bIndex = points[0].point.index; 
       var midValue = midPercentiles[bIndex]; 
       points.push({ 
        y: midValue, 
        series: { 
         name: "midSeries" 
        } 
       }); 

       var len = this.points.length; 
       for (var i = 0; i < len; i++) { 
        point = points[i]; 
        pointValue = point.y; 
        for (j = i + 1; j < len - 1; j++) { 
         pointValue = pointValue + points[j].y; 
        } 

       } 

    tooltipText += this.renderTooltipLineItem(helper.getSeriesLabel('midSeries'), 
             seriesValueHolder['midSeries']); 
    return tooltipText; 

        }, 
        shared: true 
} 

回答

0

一切正常。感謝您的答案,我會嘗試這些。 作品當我拿出extraline

for (j = i + 1; j < len - 1; j++) { 
    pointValue = pointValue + points[j].y; 
} 
0

推入一系列自定義數據,然後取回該提示上使用

this.point.custom 
+0

應該是this.point.options.custom –

相關問題