From cffbaec750882dd7f4d112d7c735d247e2a961a7 Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期五, 10 十一月 2023 13:32:50 +0800 Subject: [PATCH] # --- src/main/webapp/views/home/console.html | 530 ++++++++++++++++++++++++++++------------------------------ 1 files changed, 260 insertions(+), 270 deletions(-) diff --git a/src/main/webapp/views/home/console.html b/src/main/webapp/views/home/console.html index a3e4bb8..33eb0bc 100644 --- a/src/main/webapp/views/home/console.html +++ b/src/main/webapp/views/home/console.html @@ -10,7 +10,7 @@ <script type="text/javascript" src="../../static/js/common.js"></script> <script type="text/javascript" src="../../static/layui/layui.js"></script> <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> - <script type="text/javascript" src="../../static/js/echarts/echarts.min.js"></script> + <script type="text/javascript" src="../../static/js/echarts/echarts.min.5.4.3.js"></script> <script type="text/javascript" src="../../static/js/echarts/highcharts.js"></script> <style> body { @@ -144,63 +144,63 @@ // 楗煎浘 function pieCharts(){ $.ajax({ - url:baseUrl+'/console/loc/pie/charts', + url: baseUrl+'/console/loc/pie/charts', headers: {'token': localStorage.getItem('token')}, dataType: 'json', contentType: 'application/json;charset=UTF-8', crossDomain: true, method: 'POST', - success:function(res){ + success: function(res){ var data = res.data; - var dataPie=eval(data.rows); - var chart = { - plotBackgroundColor: null, - plotBorderWidth: null, - plotShadow: false - }; - var title = { - text: '搴撲綅浣跨敤姣斾緥', - margin:1, - style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, - y: 5 - }; - var tooltip = { - pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' - }; - var plotOptions = { - pie: { - allowPointSelect: true, - cursor: 'pointer', - dataLabels: { - enabled: true, - format: '<b>{point.name}</b>: {point.percentage:.1f} %', - style: { - color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' - } - } - } - }; - var series= [{ - type: 'pie', - name: '搴撲綅鍗犳瘮', - data: dataPie - }]; - var loading = { - hideDuration: 3, - showDuration: 3 - }; - var json = {}; - json.chart = chart; - json.title = title; - json.tooltip = tooltip; - json.series = series; - json.plotOptions = plotOptions; - json.loading = loading; - json.credits = {enabled: false}; - $('#pie').highcharts(json); + var dataPie = eval(data.rows); + Highcharts.chart('pie', { + chart: { + plotBackgroundColor: null, + plotBorderWidth: null, + plotShadow: false, + type: 'pie' + }, + title: { + text: '搴撲綅浣跨敤姣斾緥', + margin:1, + style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, + y: 5 + }, + credits:{ + enabled:false + }, + tooltip: { + pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' + }, + legend:{ + align:'right', + labelFormat:'{name}:{y}' + }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: { + enabled: true, + format: '<b>{point.name}</b>: {point.percentage:.1f} %', + style: { + color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' + } + }, + showInLegend: true, + + } + }, + series: [{ + name: '搴撲綅鍗犳瘮', + colorByPoint: true, + data: dataPie + }] + }); }, - error:function(){ + error: function(){ + // 閿欒澶勭悊 } }); } @@ -216,51 +216,49 @@ success:function(res){ var data = res.data; var dataPie=eval(data.rows); - var chart = { - plotBackgroundColor: null, - plotBorderWidth: null, - plotShadow: false - }; - var title = { - text: '搴撲綅浣跨敤姣斾緥', - margin:1, - style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, - y: 5 - }; - var tooltip = { - pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' - }; - var plotOptions = { - pie: { - allowPointSelect: true, - cursor: 'pointer', - dataLabels: { - enabled: true, - format: '<b>{point.name}</b>: {point.percentage:.1f} %', - style: { - color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' - } + Highcharts.chart('pie2', { + chart: { + plotBackgroundColor: null, + plotBorderWidth: null, + plotShadow: false, + type: 'pie' + }, + title: { + text: '搴撲綅浣跨敤姣斾緥', + margin:1, + style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, + y: 5 + }, + credits:{ + enabled:false + }, + tooltip: { + pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' + }, + legend:{ + align:'right', + labelFormat:'{name}:{y}' + }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: { + enabled: true, + format: '<b>{point.name}</b>: {point.percentage:.1f} %', + style: { + color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' + } + }, + showInLegend: true } - } - }; - var series= [{ - type: 'pie', - name: '搴撲綅鍗犳瘮', - data: dataPie - }]; - var loading = { - hideDuration: 3, - showDuration: 3 - }; - var json = {}; - json.chart = chart; - json.title = title; - json.tooltip = tooltip; - json.series = series; - json.plotOptions = plotOptions; - json.loading = loading; - json.credits = {enabled: false}; - $('#pie2').highcharts(json); + }, + series: [{ + name: '搴撲綅鍗犳瘮', + colorByPoint: true, + data: dataPie + }] + }); }, error:function(){ @@ -278,51 +276,49 @@ success:function(res){ var data = res.data; var dataPie=eval(data.rows); - var chart = { - plotBackgroundColor: null, - plotBorderWidth: null, - plotShadow: false - }; - var title = { - text: '搴撲綅浣跨敤姣斾緥', - margin:1, - style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, - y: 5 - }; - var tooltip = { - pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' - }; - var plotOptions = { - pie: { - allowPointSelect: true, - cursor: 'pointer', - dataLabels: { - enabled: true, - format: '<b>{point.name}</b>: {point.percentage:.1f} %', - style: { - color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' - } + Highcharts.chart('pie3', { + chart: { + plotBackgroundColor: null, + plotBorderWidth: null, + plotShadow: false, + type: 'pie' + }, + title: { + text: '搴撲綅浣跨敤姣斾緥', + margin:1, + style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, + y: 5 + }, + credits:{ + enabled:false + }, + tooltip: { + pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' + }, + legend:{ + align:'right', + labelFormat:'{name}:{y}' + }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: { + enabled: true, + format: '<b>{point.name}</b>: {point.percentage:.1f} %', + style: { + color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' + } + }, + showInLegend: true } - } - }; - var series= [{ - type: 'pie', - name: '搴撲綅鍗犳瘮', - data: dataPie - }]; - var loading = { - hideDuration: 3, - showDuration: 3 - }; - var json = {}; - json.chart = chart; - json.title = title; - json.tooltip = tooltip; - json.series = series; - json.plotOptions = plotOptions; - json.loading = loading; - json.credits = {enabled: false}; - $('#pie3').highcharts(json); + }, + series: [{ + name: '搴撲綅鍗犳瘮', + colorByPoint: true, + data: dataPie + }] + }); }, error:function(){ @@ -340,51 +336,49 @@ success:function(res){ var data = res.data; var dataPie=eval(data.rows); - var chart = { - plotBackgroundColor: null, - plotBorderWidth: null, - plotShadow: false - }; - var title = { - text: '搴撲綅浣跨敤姣斾緥', - margin:1, - style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, - y: 5 - }; - var tooltip = { - pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' - }; - var plotOptions = { - pie: { - allowPointSelect: true, - cursor: 'pointer', - dataLabels: { - enabled: true, - format: '<b>{point.name}</b>: {point.percentage:.1f} %', - style: { - color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' - } + Highcharts.chart('pie4', { + chart: { + plotBackgroundColor: null, + plotBorderWidth: null, + plotShadow: false, + type: 'pie' + }, + title: { + text: '搴撲綅浣跨敤姣斾緥', + margin:1, + style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, + y: 5 + }, + credits:{ + enabled:false + }, + tooltip: { + pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' + }, + legend:{ + align:'right', + labelFormat:'{name}:{y}' + }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: { + enabled: true, + format: '<b>{point.name}</b>: {point.percentage:.1f} %', + style: { + color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' + } + }, + showInLegend: true } - } - }; - var series= [{ - type: 'pie', - name: '搴撲綅鍗犳瘮', - data: dataPie - }]; - var loading = { - hideDuration: 3, - showDuration: 3 - }; - var json = {}; - json.chart = chart; - json.title = title; - json.tooltip = tooltip; - json.series = series; - json.plotOptions = plotOptions; - json.loading = loading; - json.credits = {enabled: false}; - $('#pie4').highcharts(json); + }, + series: [{ + name: '搴撲綅鍗犳瘮', + colorByPoint: true, + data: dataPie + }] + }); }, error:function(){ @@ -402,51 +396,49 @@ success:function(res){ var data = res.data; var dataPie=eval(data.rows); - var chart = { - plotBackgroundColor: null, - plotBorderWidth: null, - plotShadow: false - }; - var title = { - text: '搴撲綅浣跨敤姣斾緥', - margin:1, - style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, - y: 5 - }; - var tooltip = { - pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' - }; - var plotOptions = { - pie: { - allowPointSelect: true, - cursor: 'pointer', - dataLabels: { - enabled: true, - format: '<b>{point.name}</b>: {point.percentage:.1f} %', - style: { - color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' - } + Highcharts.chart('pie5', { + chart: { + plotBackgroundColor: null, + plotBorderWidth: null, + plotShadow: false, + type: 'pie' + }, + title: { + text: '搴撲綅浣跨敤姣斾緥', + margin:1, + style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, + y: 5 + }, + credits:{ + enabled:false + }, + tooltip: { + pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' + }, + legend:{ + align:'right', + labelFormat:'{name}:{y}' + }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: { + enabled: true, + format: '<b>{point.name}</b>: {point.percentage:.1f} %', + style: { + color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' + } + }, + showInLegend: true } - } - }; - var series= [{ - type: 'pie', - name: '搴撲綅鍗犳瘮', - data: dataPie - }]; - var loading = { - hideDuration: 3, - showDuration: 3 - }; - var json = {}; - json.chart = chart; - json.title = title; - json.tooltip = tooltip; - json.series = series; - json.plotOptions = plotOptions; - json.loading = loading; - json.credits = {enabled: false}; - $('#pie5').highcharts(json); + }, + series: [{ + name: '搴撲綅鍗犳瘮', + colorByPoint: true, + data: dataPie + }] + }); }, error:function(){ @@ -464,51 +456,49 @@ success:function(res){ var data = res.data; var dataPie=eval(data.rows); - var chart = { - plotBackgroundColor: null, - plotBorderWidth: null, - plotShadow: false - }; - var title = { - text: '搴撲綅浣跨敤姣斾緥', - margin:1, - style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, - y: 5 - }; - var tooltip = { - pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' - }; - var plotOptions = { - pie: { - allowPointSelect: true, - cursor: 'pointer', - dataLabels: { - enabled: true, - format: '<b>{point.name}</b>: {point.percentage:.1f} %', - style: { - color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' - } + Highcharts.chart('pie6', { + chart: { + plotBackgroundColor: null, + plotBorderWidth: null, + plotShadow: false, + type: 'pie' + }, + title: { + text: '搴撲綅浣跨敤姣斾緥', + margin:1, + style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, + y: 5 + }, + credits:{ + enabled:false + }, + tooltip: { + pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' + }, + legend:{ + align:'right', + labelFormat:'{name}:{y}' + }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: { + enabled: true, + format: '<b>{point.name}</b>: {point.percentage:.1f} %', + style: { + color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' + } + }, + showInLegend: true } - } - }; - var series= [{ - type: 'pie', - name: '搴撲綅鍗犳瘮', - data: dataPie - }]; - var loading = { - hideDuration: 3, - showDuration: 3 - }; - var json = {}; - json.chart = chart; - json.title = title; - json.tooltip = tooltip; - json.series = series; - json.plotOptions = plotOptions; - json.loading = loading; - json.credits = {enabled: false}; - $('#pie6').highcharts(json); + }, + series: [{ + name: '搴撲綅鍗犳瘮', + colorByPoint: true, + data: dataPie + }] + }); }, error:function(){ -- Gitblit v1.9.1