/*+++++++图标通用脚本+++++++++*/ /** * 创建统计图表 * @param {Object} userInfo 传入的用户模型 * @param {Object} callback 回调函数 */ function echartsCreateCount(userInfo,callback){ var countInfo = userInfo.countInfo; //获取统计信息 var yesAssign = parseInt(countInfo.case_all) - parseInt(countInfo.wait_assign); var waitCheck = parseInt(countInfo.wait_check); var waitFlight = parseInt(countInfo.wait_flight); var waitVerify = parseInt(countInfo.wait_verify); var close = parseInt(countInfo.case_close); var yesCheck = yesAssign - waitCheck; /* 计算 派发处理率以及审核结案率 */ var checkRate = ((yesCheck/yesAssign)*100).toFixed(2) + "%"; var closeRate = ((waitVerify/yesCheck)*100).toFixed(2) + "%"; /* 初始化统计图表 */ var option = { title: { text: '案件动态信息', }, tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, grid: { x: 50, x2: 20, y: 50, y2: 25, containLabel: true }, xAxis: { type: 'value', boundaryGap: [0, 0.01] }, yAxis: { type: 'category', data: ['已派发', '待处理', '待复飞', '待审核', '已结案'], axisLabel: { textStyle: { color: '#000000', } } }, series: [{ name: '统计', type: 'bar', data: [yesAssign, waitCheck, waitFlight, waitVerify, close], itemStyle: { normal: { color: function(params) { var colorList = ['#323499', '#fd2322', '#ffc229', '#ad69d8', '#07891c']; return colorList[params.dataIndex]; }, label: { show: true, position: 'right', textStyle: { color: '#000000', }, formatter: function(val) { return val.data + '件'; } } } }, }] }; //回调 callback(option,checkRate,closeRate); }