| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339 |
- <!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="stocklandType" id="stocklandType">
- <option value="">--请选择--</option>
- <option value="" th:each="item : ${stocklandTypeList}" th:value="${item.value}" th:text="${item.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: {
- categories: ['股权', '不动产权', '使用用途', '出租']
- },
- yAxis: {
- min: 0,
- title: {
- text: '单据数量'
- },
- stackLabels: { // 堆叠数据标签
- enabled: true,
- style: {
- fontWeight: 'bold',
- color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
- }
- }
- },
- legend: {
- align: 'right',
- x: -30,
- verticalAlign: 'top',
- y: 25,
- floating: true,
- backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
- borderColor: '#CCC',
- borderWidth: 1,
- shadow: false
- },
- tooltip: {
- formatter: function () {
- return '<b>' + this.x + '</b><br/>' +
- this.series.name + ': ' + this.y + '<br/>' +
- '总量: ' + this.point.stackTotal;
- }
- },
- plotOptions: {
- column: {
- stacking: 'normal',
- dataLabels: {
- enabled: true,
- color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white',
- style: {
- // 如果不需要数据标签阴影,可以将 textOutline 设置为 'none'
- textOutline: '1px 1px black'
- }
- }
- }
- },
- 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() {
- $.ajax({
- type: "get",
- dataType: "json",
- data: {
- begin_date: $("#begin_date").val(),
- end_date: $("#end_date").val()
- },
- url: pagePath+ "/statistics/getApplyRate",
- 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);
- var title = {
- text:"存量工业用地变更申请单据占比"
- };
- chart.setTitle(title);
- chart.series[0].setData(data);
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- //存量工业用地变更申请结果占比
- function applyResultRate() {
- //初始化饼图
- var initPie ={
- chart: {
- plotBackgroundColor: null,
- plotBorderWidth: null,
- plotShadow: false
- },
- 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(),
- stocklandType: $("#stocklandType").val()
- },
- url: pagePath+ "/statistics/getApplyResult",
- 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 title = {
- text:"存量工业用地变更申请结果占比"
- };
- var subtitle = {
- text: "<div style='height: 24px'></div>",
- useHTML: true
- };
- chart.setTitle(title);
- chart.setSubtitle(subtitle);
- chart.series[0].setData(data);
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- //各单位处理单据对比
- function streetCompare(){
- // var chart = Highcharts.chart('street_container', initColumn);
- $.ajax({
- type: "get",
- dataType: "json",
- data: {
- begin_date: $("#begin_date").val(),
- end_date: $("#end_date").val()
- },
- url: pagePath + "/statistics/getStreetHandleCompare",
- 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].equity);
- data.push(value[j].property);
- data.push(value[j].use);
- data.push(value[j].rent);
- 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>
|