var myChart1=echarts.init(document.getElementById('gauge'));
option1 = {
    series: [{
        name: '信用分',
        type: 'gauge',
        min: 0,
        max: 100,
        splitNumber:8,
        axisLine: {
            show: true,
            lineStyle: {
                width: 20,
                shadowBlur: 0,
                color: [
                    [0.25, '#E43F3D'],
                    [0.5, '#E98E2C'],
                    [0.75, '#7CBB55'],
                    [1, '#9CD6CE']
                ]
            }
        },

        axisTick: {
            show: true,
            splitNumber: 1
        },
        splitLine: {
             show: false,
             lineStyle:{
                 opacity:0.1
             }
         },
          pointer : {
           show:true,
         },
         axisLabel: {
             formatter: function(e) {
                 switch (e + "") {
                     case "12.5":
                         return "极差";
                     case "37.5":
                         return "较差";
                     case "62.5":
                         return "良好";
                     case "87.5":
                         return "优秀";
                     default:
                         return e;
                 }
             },
             textStyle: {
                 fontSize: 12,
                 fontWeight: ""
             }
         },
         detail: {
             formatter: function(param) {
                 var level = '';
                 if (param <= 25) {
                     level ='信用极差'
                 } else if (param <= 50) {
                     level ='信用较差'
                 } else if (param <= 75) {
                     level = '信用良好'
                 } else  {
                     level = '信用优秀'
                 } 
                 return level;
             },
             offsetCenter: [0,100],
             textStyle: {
                 fontSize: 30
             }
         },
         data: [{
             name: "",
             value: dataCR//存放返回的数据
         }]
     }]
 };
 myChart1.setOption(option1);

 

Logo

智屏生态联盟致力于大屏生态发展,利用大屏快应用技术降低开发者开发、发布大屏应用门槛

更多推荐