2014-10-30 89 views
0

我想将范围显示为我的图例。一个示例仪表可能类似this显示范围为高度图角度计的图例

我可以拥有它吗,以便我可以根据这些值为颜色和文字[Bad/Good/Excellent]创建传说吗?

plotBands: [{ 
      from: 0, 
      to: 120, 
      color: '#55BF3B' // green 
     }, { 
      from: 120, 
      to: 160, 
      color: '#DDDF0D' // yellow 
     }, { 
      from: 160, 
      to: 200, 
      color: '#DF5353' // red 
     }] 

回答

1

当然,只是创造传奇独立系列,并启用它们:http://jsfiddle.net/kbvC3/734/

series: [{ 
     name: 'Speed', 
     data: [80], 
     tooltip: { 
      valueSuffix: ' km/h' 
     } 
    }, { 
     showInLegend: true, 
     name: "Bad", 
     color: '#55BF3B' // green 
    }, { 
     showInLegend: true, 
     name: "Good", 
     color: '#DDDF0D' // yellow 
    }, { 
     showInLegend: true, 
     name: "Excellent", 
     color: '#DF5353' // red 
    }]