Highcharts solidgauge : How can I disable gradient fill?

后端 未结 3 781
孤街浪徒
孤街浪徒 2021-01-12 15:08

I\'m trying to use Highcharts new solidgauge plugin.

http://jsfiddle.net/4zVU8/2/

source code as provided by highchart

3条回答
  •  生来不讨喜
    2021-01-12 15:48

    // change your stops ,0 and 1 set the same value
    var showNumber = 100; // your random data
    var tickMaxNumber = 1000; // The yAxis max value 
    if(showNumber <= tickMaxNumber*0.2){
        gaugeOptions.yAxis[0].stops = [ // red
            [0, '#EE4B4B'],
            [1, '#EE4B4B']
        ];
    }else if(showNumber <= tickMaxNumber*0.8){
        gaugeOptions.yAxis[0].stops = [ // yellow
            [0, '#FFC063'],
            [1, '#FFC063']
        ];
    }else{
        gaugeOptions.yAxis[0].stops = [ // green
            [0, '#40A276'],
            [1, '#40A276']
        ];
    }
    
    $('#container-speed').highcharts(gaugeOptions);
    

提交回复
热议问题