2014-03-03 28 views
1

我想添加我的圖表(errorBar類型),每個點的最小值和最大值。HighCharts:dataLabels errorBar

爲以下鏈接:JSFiddle

我能做到這一點對我的各種圖形用下面的代碼:

dataLabels: { 
     enabled: true, 
     style: { 
      font: 'bold 11px Arial', 
      textShadow: '0 0 3px white, 0 0 3px white ' 
     } 
    } 

是否有可能呢? Thx

回答

2

這看起來像一個錯誤(或至少一個oversiterts)與highcharts。我找不到dataLabels選項的任何組合,這些選項將與errorbar類型圖表一起使用。如果你真的需要這種能力,我會再打一個電話Renderer.text做自己:

function(chart){ 
    var points = chart.series[0].points; 
    for (var i = 0; i < points.length; i++){ 
     var p = points[i]; 
     chart.renderer.text("High: "+p.high, p.plotX+chart.plotLeft-20, p.highPlot+chart.plotTop-5).add(); 
     chart.renderer.text("Low: "+p.low, p.plotX+chart.plotLeft-20, p.lowPlot+chart.plotTop+12).add(); 
} 

結果(小提琴here):

enter image description here

相關問題