在公司作了一版dashboard,對echarts有了大量的實踐。堅果圖,日曆圖,折線圖,地理圖。難易程度排名爲堅果圖,折線圖,日曆圖,地理圖。總結了如下幾點注意事項:json
利用好回調函數,能夠極大的增長圖表個性化。如數組
tooltip : { trigger: 'item', formatter : function (params) { var value = params.value[1].toString().replace(/(\d{1,3})(?=(\d{3})+$)/g,function($1){return $1=$1+','}) return `${params.value[0]}<br/>活躍人次:${value}` } }
visualMap: [ { type: 'piecewise', min: 0, max: 100, bottom: 60, left: "left", pieces: [ {min: 0, max: 59,label: '<60%',color:'#FF4177'}, {min: 60, max: 70, label: '60%-70%',color:'#FFA45A'}, {min: 71, max: 89, label: '71%-89%',color:'#FFDC5A'}, {min: 90, max: 100, label: '90%-100%',color:'#00B743'}, ], dimension:2 }
data: [["115.88", "26.863", 99, 99,77,"430000",四川]], params[0].value[6] :四川