"use strict";var myChart;var myPieChart;var myParamjson;$(function(){myChart=echarts.init(document.getElementById("echartBox"),"macarons");myPieChart=echarts.init(document.getElementById("echartPie"),"macarons")});function buildExpMyChart(n,c,h,g){var m=n.rows[0];paramjson=JSON.parse(m.paramjson);var k=paramjson.grid;var l="文献借阅排行榜";var o="题名";var f=false;if(g=="name"){l="读者借阅排行榜";o="读者姓名";for(var d=0;d0){var h=i.rows[0];var k=JSON.parse(h.paramjson);myParamjson=k;var a=k.grid;var e=k.item_value1;var c=k.item_value2;if(a.length==1&&(!e||!c)){d=buildGridChart(a,k,j,g);buildPeiChart(k,j,g)}else{if(a.length>1&&(!e||!c)){d=buildGridChart(a,k,j,g)}else{d=buildComChart(a,k,j,g)}}}else{d=noDataChartLoad(g)}myChart.setOption(d);$(".countDisplayArea").hide();$(".pieDisplayArea").hide()}function buildGridChart(c,k,j,h){var d=[];for(var e=0;e{b} : {c} ({d}%)"},toolbox:{show:true,feature:{mark:{show:true},magicType:{show:true,type:["pie"]},restore:{show:true},saveAsImage:{show:true}}},legend:{orient:"vertical",x:"left",data:b},calculable:false,series:d};myPieChart.setOption(e);$(".countDisplayArea").hide();$(".pieDisplayArea").hide()}function getDataArr(b){if(b){var d=[];var f=b.split(/[\n\r]/g);for(var c=0;c1){d.push(a[1])}else{d.push(e)}}}}return d}function getItemParam(b){var a={};var c;var d=0;var f=b.item_value1;var e=b.item_value2;if(f){c=f;if(b.item_sum1=="1"){d+=1}if(b.item_other1=="1"){d+=1}}else{if(e){c=e;if(b.item_sum2=="1"){d+=1}if(b.item_other2=="1"){d+=1}}}a.valText=c;a.leng=d;return a}function getPieSeries(j,h,f,a){var d={};d.name=f.text;d.type="pie";var c=[];var b=h[0].datalist;for(var e=1;e1){g.name=b[e][0];g.value=parseInt(b[e][1]);c.push(g)}}d.data=c;return d}function getSeriesData(o,c,f,a,d){var e=[];var h=o[0].datalist;for(var l=1;l1){if(!/^[0-9]+$/.test(j[1])){b+=j[1]}}m.name=b;m.type="bar";var n=[];for(var g=j.length-f.length;g0){n.push(j[g])}}m.data=n;e.push(m)}return e}function noDataChartLoad(d){var c={normal:{label:{textStyle:{fontSize:27,color:"#666",align:"center"}}}};var a={normal:{color:"#ccc",label:{show:true,position:"center"},labelLine:{show:false}},emphasis:{color:"rgba(0,0,0,0)"}};var b={title:d,tooltip:{trigger:"item",formatter:"{a}
{b} : {c} ({d}%)"},legend:{orient:"vertical",x:"right",data:[]},series:[{type:"pie",center:["50%","50%"],itemStyle:c,data:[{name:"暂无数据",value:0,itemStyle:a}]}]};return b};