Edit D:\rfid\libsystem\page\statistics\js\mychart.js
"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;d<k.length;d++){if(k[d].code=="name"){f=true;break}}if(!f){alert("??????????????????????");return}}else{for(var d=0;d<k.length;d++){if(k[d].code=="title"){f=true;break}}if(!f){alert("??????????????????");return}}var b=[];var a=[];var p=c.rows;for(var d=0;d<p.length;d++){b.push(p[d][g]);var j=parseInt(p[d].count);a.push(j)}var e={title:{text:l,subtext:"?????"},tooltip:{trigger:"axis"},legend:{data:[o]},toolbox:{show:true,feature:{mark:{show:true},dataView:{show:false,readOnly:false},magicType:{show:true,type:["line","bar"]},restore:{show:true},saveAsImage:{show:true}}},calculable:true,xAxis:[{type:"category",data:b}],yAxis:[{type:"value"}],series:[{name:o,type:"bar",data:a,markPoint:{data:[{type:"max",name:"??????"},{type:"min",name:"??????"}]},markLine:{data:[{type:"average",name:"?????"}]}}]};myChart.setOption(e);$(".countDisplayArea").hide()}function buildMyChart(i,b,f){var d={};var g={};g.text=f;var j=b.rows;if(j.length>0){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<c.length;e++){d.push(c[e].name)}var g=getItemParam(k);var f=g.valText;var a=g.leng;var b=getDataArr(f);return getComOption(b,d,j,h,a,c)}function getComOption(b,e,l,j,a,c){var d=getSeriesData(l,b,e,a,c);var k="";if(c.length==1){k=c[0].name}var h=[];for(var f=0;f<d.length;f++){h.push(d[f].name)}if(myParamjson){if(myParamjson.item_field1==myParamjson.item_field2){e=h}}var g={title:j,tooltip:{trigger:"axis"},grid:{left:"10%",bottom:"15%"},toolbox:{show:true,feature:{mark:{show:true},magicType:{show:true,type:["line","bar"]},restore:{show:true},saveAsImage:{show:true}}},calculable:true,legend:{data:h,type:"scroll",orient:"horizontal",x:"center",y:"bottom",},xAxis:[{type:"category",axisLabel:{interval:0,rotate:30},splitLine:{show:false},data:e}],yAxis:[{type:"value",position:"left",axisLabel:{formatter:"{value}"+k}}],series:d};return g}function buildComChart(c,i,h,g){var d=getDataArr(i.item_value2);var f=getItemParam(i);var e=f.valText;var a=f.leng;var b=getDataArr(e);return getComOption(b,d,h,g,a,c)}function buildPeiChart(j,i,h){$(".pie-class").show();var c=j.grid;var g=getItemParam(j);var f=g.valText;var a=g.leng;var b=getDataArr(f);var d=getPieSeries(j,i,h,a);h.x="center";var e={title:h,tooltip:{trigger:"item",formatter:"{a} <br/>{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;c<f.length;c++){var e=f[c];if(e){var a=e.split("|");if(a.length>1){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;e<b.length-a;e++){var g={};if(b[e].length>1){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;l<h.length-a;l++){var j=h[l];var m={};var b=j[0];if(d.length>1){if(!/^[0-9]+$/.test(j[1])){b+=j[1]}}m.name=b;m.type="bar";var n=[];for(var g=j.length-f.length;g<j.length;g++){if(parseInt(j[g])>0){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} <br/>{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};
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de