| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- <!DOCTYPE HTML>
- <html xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorate="~{admin/common/common}">
- <head>
- <title>总体统计</title>
- <style>
- #apply_container {
- height: 400px;
- }
- #result_container {
- height: 400px;
- }
- #street_container {
- height: 500px;
- }
- </style>
- </head>
- <body layout:fragment="content">
- <div class="page-container">
- <form class="form form-horizontal" id="form-add" th:action="@{/statistics/getOverallAnalysis}" th:method="get">
- <input type="hidden" id="chartType" name="chartType"/>
- <div>
- <label>开始日期:</label><input type="text" class="input-text" style="width:200px" readonly placeholder="请输入开始日期" id="begin_date" name="begin_date" />
- <label>结束日期:</label><input type="text" class="input-text" style="width:200px" readonly placeholder="请输入结束日期" id="end_date" name="end_date" />
- <span><a onclick="streetDeclaer()" class="btn btn-info radius"><i class="Hui-iconfont"></i> 搜索</a></span>
- </div>
- <div class="clearfix width-row">
- <div class="width-half">
- <div class="chart_data">
- <div id="apply_container"></div>
- </div>
- </div>
- <div class="width-half">
- <div class="chart_data">
- <div class="sel-box sel-box-recove">
- <select class="select" onChange="changeType()"
- th:name="projectType" id="projectType">
- <option value="">--请选择--</option>
- <option value="" th:each="item : ${projectTypeList}" th:value="${item.id}" th:text="${item.type_name}">
- </option>
- </select>
- </div>
- <div id="result_container"></div>
- </div>
- </div>
- </div>
- <div class="chart_data">
- <div id="street_container"></div>
- </div>
- </form>
- </div>
- <script type="text/javascript" th:src="@{/js/lib/highcharts/highcharts.js}"></script>
- <script type="text/javascript" th:src="@{/js/lib/highcharts/exporting.js}"></script>
- <script type="text/javascript" th:src="@{/js/lib/highcharts/highcharts-zh_CN.js}"></script>
- <style>
- a.cur{
- background: #0a6999;color:#fff;
- }
- </style>
- <script th:inline="javascript">
- $(function () {
- $(".highlight a").click(function(){
- $(this).addClass("cur").parent().siblings().find("a").removeClass("cur")
- });
- applyRate();
- applyResultRate();
- streetCompare();
- });
- //初始化柱形图
- var initColumn = {
- chart: {
- type: 'column'
- },
- title: {
- text: '各街道单据数量对比'
- },
- xAxis: {
- crosshair: true,
- labels: {
- enabled: false
- }
- },
- yAxis: {
- min: 0,
- allowDecimals: false,
- title: {
- text: '',
- align: 'high'
- },
- labels: {
- overflow: 'justify'
- }
- },
- tooltip: {
- formatter : function(){
- return '<span style="font-size: 12px">'+this.series.name+':'+this.y+'个</span>';//这里随便你返回什么东西吧
- }
- },
- plotOptions: {
- column: {
- pointPadding: 0.2,
- borderWidth: 0
- }
- },
- series: []
- };
- //初始化饼图
- var initPie ={
- chart: {
- plotBackgroundColor: null,
- plotBorderWidth: null,
- plotShadow: false
- },
- title: {
- text: '区级工业经济扶持申请单据占比'
- },
- tooltip: {
- headerFormat: '',
- pointFormat: '{point.name}: <b>{point.y}</b> '
- },
- plotOptions: {
- pie: {
- allowPointSelect: true,
- cursor: 'pointer',
- dataLabels: {
- enabled: true,
- // 通过 format 或 formatter 来格式化数据标签显示
- //format: '值: {point.y} 占比 {point.percentage} %',
- formatter: function () {
- //this 为当前的点(扇区)对象,可以通过 console.log(this) 来查看详细信息
- return '<span"> ' + this.point.name + ':' + this.y + '</span>';
- }
- },
- showInLegend: true // 显示在图例中
- }
- },
- series: [{
- type: 'pie',
- name: ''
- }]
- };
- //存量工业用地变更申请单据占比
- function applyRate() {
- $("#chartType").val(2);
- $.ajax({
- type: "get",
- dataType: "json",
- data: {
- begin_date: $("#begin_date").val(),
- end_date: $("#end_date").val()
- },
- url: pagePath+ "/statistics/getProjectTypeRate",
- success: function (result) {
- console.log(result);
- if (result.success) {
- var value = result.obj;
- var data = [];
- for(var j=0;j<value.length;j++){
- data.push({"name":value[j].type, "y":value[j].overallNum});
- }
- console.log(data);
- var chart = new Highcharts.Chart("apply_container", initPie);
- chart.series[0].setData(data);
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- //存量工业用地变更申请结果占比
- function applyResultRate() {
- //初始化饼图
- var initPie ={
- chart: {
- plotBackgroundColor: null,
- plotBorderWidth: null,
- plotShadow: false
- },
- title: {
- text: '区级工业经济扶持申请结果占比'
- },
- tooltip: {
- headerFormat: '',
- pointFormat: '{point.name}: <b>{point.y}</b> '
- },
- plotOptions: {
- pie: {
- allowPointSelect: true,
- cursor: 'pointer',
- dataLabels: {
- enabled: true,
- // 通过 format 或 formatter 来格式化数据标签显示
- //format: '值: {point.y} 占比 {point.percentage} %',
- formatter: function () {
- //this 为当前的点(扇区)对象,可以通过 console.log(this) 来查看详细信息
- return '<span"> ' + this.point.name + ':' + this.y + '</span>';
- }
- },
- showInLegend: true // 显示在图例中
- }
- },
- series: [{
- type: 'pie',
- name: ''
- }]
- };
- $.ajax({
- type: "get",
- dataType: "json",
- data: {
- begin_date: $("#begin_date").val(),
- end_date: $("#end_date").val(),
- projectType: $("#projectType").val()
- },
- url: pagePath+ "/statistics/getProjectResult",
- success: function (result) {
- console.log(result);
- if (result.success) {
- var value = result.obj;
- var data = [];
- for(var j=0;j<value.length;j++){
- data.push({"name":value[j].type,"y":value[j].overallNum});
- }
- var chart = new Highcharts.Chart("result_container", initPie);
- var subtitle = {
- text: "<div style='height: 24px'></div>",
- useHTML: true
- };
- chart.setSubtitle(subtitle);
- chart.series[0].setData(data);
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- //各单位处理单据对比
- function streetCompare(){
- $.ajax({
- type: "get",
- dataType: "json",
- data: {
- begin_date: $("#begin_date").val(),
- end_date: $("#end_date").val()
- },
- url: pagePath + "/statistics/getProjectHandleCompare",
- success: function (result) {
- console.log(result);
- if (result.success) {
- var chart = Highcharts.chart('street_container', initColumn);
- var value = result.obj;
- for(var j=0;j < value.length;j++){
- var data = [];
- data.push(value[j].overallNum);
- console.log(data);
- chart.addSeries({
- name: value[j].streetName,
- data: data
- });
- }
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- function changeType(){
- applyResultRate();
- }
- function streetDeclaer(){
- applyRate();
- applyResultRate();
- streetCompare();
- }
- laydate.render({
- elem: '#begin_date', //指定元素
- // min: 0
- });
- laydate.render({
- elem: '#end_date', //指定元素
- // min: 0
- });
- </script>
- </body>
- </html>
|