2017-08-21 138 views
0

我正在使用Highchart的Char Bar,不知道是否有一种显示平均线(绘图线)值的方式,显示'yAxis'中的值或鼠标悬停用绘图线的确切值显示一个对话框。在yAxis Highcharts上显示PlotLine值

我已经显示了平均线,但我无法读出图上的EXACT值。

这是从Highchart

plotLines: [{ 
    color: 'red', 
    value: avg, // Insert your average here 
    width: '1', 
    zIndex: 2 // To not get stuck below the regular plot lines 
}] 

enter image description here

回答

0

的主要情节你​​应该能够显示一个标签:

plotLines: [{ 
    color: 'red', 
    value: avg, // Insert your average here 
    width: '1', 
    zIndex: 2, // To not get stuck below the regular plot lines 
    label: { 
     text: avg, 
     textAlign: 'left', 
     x: -40 
    } 
}] 

Reference

+0

是的,这是给我确切avg的价值,但是,这是一种在“yAxis”上“加密”它的方法吗? –

+0

@BennyBuAc你必须玩弄标签属性。我已更新我的答案以显示一些样本值 –

+1

您还可以增加zIndex值以显示列上方的行。例如:http://jsfiddle.net/chxsLa9a/。 –

相关问题