| | |
| | | <div class="statistics_txt"> |
| | | <div class="title">统计结果</div> |
| | | <div class="statistics_scroll" style="padding:0"> |
| | | <div id="tab_statistical" class="fulltext_row2"> |
| | | <iframe name="statisticsIframe" id="statisticsIframe" width="100%" frameborder="no" border="0" |
| | | marginwidth="0" marginheight="0" allowtransparency="yes"></iframe> |
| | | <div id="tab_statistical" class="fulltext_row2" style="width: 100%;height:100%;"> |
| | | <div id="pie_statisticals" style="width: 100%;height:100%;overflow: hidden;"></div> |
| | | <%-- <iframe name="statisticsIframe" id="statisticsIframe" width="100%" frameborder="no" border="0"--%> |
| | | <%-- marginwidth="0" marginheight="0" allowtransparency="yes"></iframe>--%> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | }) |
| | | |
| | | function utilizationStatistics() { |
| | | var myChart = echarts.init(document.getElementById('pie_statisticals')); |
| | | var colors = ['#87CEFA', '#945b6c', '#00FFFF', '#FFA500']; |
| | | option = { |
| | | title: { |
| | | text: '借阅统计', |
| | | left: 'center', |
| | | textStyle: { |
| | | color: '#0c0c0c' |
| | | } |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item', |
| | | formatter: '{a} <br/>{b}: {c} ({d}%)' |
| | | }, |
| | | legend: { |
| | | orient: 'vertical', |
| | | left: 'left', |
| | | data: ['非密', '内部', '秘密', '机密'], |
| | | textStyle: { |
| | | color: '#0e0e0e' |
| | | } |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '纸质借阅', |
| | | type: 'pie', |
| | | radius: ['0%', '40%'], // 内半径和外半径 |
| | | center: ['50%', '50%'], // 圆心位置 |
| | | data: [], |
| | | color: colors, |
| | | label: { |
| | | color: '#2d2424' |
| | | } |
| | | }, |
| | | { |
| | | name: '电子借阅', |
| | | type: 'pie', |
| | | radius: ['50%', '70%'], // 内半径和外半径 |
| | | center: ['50%', '50%'], // 圆心位置 |
| | | data: [], |
| | | color: colors, |
| | | label: { |
| | | color: '#100f0f' |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | var reportFile = "borrow_approval_hn.ureport%202.xml"; |
| | | var path = "<%=path%>"; |
| | | var url = path + "/ureport/preview?_u=file:" + reportFile ; |
| | | $('#statisticsIframe').attr('src', url); //注:不能用window.open方式打开,否则放大缩小会被清空 |
| | | myChart.showLoading(); //loading动画 |
| | | |
| | | $.ajax({ |
| | | type: "post", |
| | | async: true, |
| | | url: "screen/getBorrowEchartsPie", |
| | | dataType: "json", |
| | | success: function (result) { |
| | | if (result) { |
| | | myChart.hideLoading(); |
| | | // 假设返回的数据包含纸质借阅和电子借阅两组数据 |
| | | myChart.setOption({ |
| | | series: [ |
| | | { data: result.paperData || [] }, // 纸质借阅数据 |
| | | { data: result.electronicData || [] } // 电子借阅数据 |
| | | ] |
| | | }); |
| | | } |
| | | }, |
| | | error: function (errorMsg) { |
| | | //请求失败时执行该函数 |
| | | alert("请求数据失败!"); |
| | | myChart.hideLoading(); |
| | | } |
| | | }); |
| | | |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | <%--var reportFile = "borrow_approval_hn.ureport%202.xml";--%> |
| | | <%--var path = "<%=path%>";--%> |
| | | <%--var url = path + "/ureport/preview?_u=file:" + reportFile ;--%> |
| | | <%--$('#statisticsIframe').attr('src', url); //注:不能用window.open方式打开,否则放大缩小会被清空--%> |
| | | } |
| | | |
| | | </script> |