echarts設置y軸 自定義顏色

根據業務需求,特殊標記點設置特殊提示

在color:function()中進行判斷,同理如果顯示label自定義在formatter中進行

yAxis:{
{
    type: 'value',
    name: '溫度',
    min: 0,
    max: 25,
    position: 'left',
    axisLine: {
       lineStyle: {
          color: '#675bba'
       }
    },
    axisLabel: {
       formatter: '{value} °C',
       color:function(v){
           if(v==20){
              return '#e61717'
           }else{
             return '#675bba'
            }
       }
    }
  }

}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章