【问题标题】:Show ranges as legend for highcharts angular gauge将范围显示为 highcharts 角规的图例
【发布时间】:2014-10-31 19:41:25
【问题描述】:

我想将范围显示为我的图例。一个示例仪表类似于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
        }] 

【问题讨论】:

    标签: highcharts highstock


    【解决方案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  
        }]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-10
      • 2016-01-16
      • 1970-01-01
      • 2017-01-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多