Explorar o código

数据中心数据绑定

yf_zd %!s(int64=5) %!d(string=hai) anos
pai
achega
1651035013
Modificáronse 1 ficheiros con 44 adicións e 30 borrados
  1. 44 30
      templates/backstageNet/datacenter/industrydata.html

+ 44 - 30
templates/backstageNet/datacenter/industrydata.html

@@ -262,11 +262,11 @@
                 trigger: 'item',
                 formatter: "{a} <br/>{b} : {c} ({d}%)"
             },
-            // legend: {
-            //     orient: 'vertical',
-            //     x: 'left',
-            //     data: ['直接访问', '邮件营销', '联盟广告', '视频广告', '搜索引擎']
-            // },
+            legend: {
+                orient : 'vertical',
+                x : 'right',
+                data: []
+            },
             toolbox: {
                 show: true,
                 x: 'right',
@@ -290,35 +290,48 @@
             series: [
                 {
                     name: '收益占比',
-                    type: 'pie',
-                    radius: '80%',
-                    center: ['50%', '50%'],
-                    data: [
-                        { value: 335, name: '农场一' },
-                        { value: 310, name: '农场二' },
-                        { value: 234, name: '农场三' },
-                        { value: 135, name: '农场四' },
-                        { value: 548, name: '农场五' }
-                    ],
-                    itemStyle: {
-                        normal: {
-                            label: {            //饼图图形上的文本标签
-                                show: true,
-                                position: 'inner', //标签的位置
-                                textStyle: {
-                                    color: "#fff",
-                                    fontWeight: 300,
-                                    fontSize: 14    //文字的字体大小
-                                },
-                                formatter: '{b}\n({d}%)'
+                    type:'pie',
+                    radius : ['50%', '70%'],
+                    itemStyle : {
+                        normal : {
+                            label : {
+                                show : false
                             },
-
-                            labelLine: {
-                                show: false   //隐藏标示线
+                            labelLine : {
+                                show : false
+                            }
+                        },
+                        emphasis : {
+                            label : {
+                                show : true,
+                                position : 'center',
+                                textStyle : {
+                                    fontSize : '14',
+                                    fontWeight : 'bold'
+                                }
                             }
                         }
                     },
-                }
+                    data: [],
+                    // itemStyle: {
+                    //     normal: {
+                    //         label: {            //饼图图形上的文本标签
+                    //             show: true,
+                    //             position: 'inner', //标签的位置
+                    //             textStyle: {
+                    //                 color: "#fff",
+                    //                 fontWeight: 300,
+                    //                 fontSize: 14    //文字的字体大小
+                    //             },
+                    //             formatter: '{b}\n({d}%)'
+                    //         },
+
+                    //         labelLine: {
+                    //             show: false   //隐藏标示线
+                    //         }
+                    //     }
+                    // },
+                },
             ]
         };
         setTimeout(function () {
@@ -357,6 +370,7 @@
                                 bar_option.series[0].data = money;
                                 var barChart = echarts.init(document.getElementById('bar-chart'));
                                 barChart.setOption(bar_option)
+                                // pie_option.legend = { data:farm,orient : 'vertical',x : 'right',};
                                 pie_option.series[0].data = pieData;
                                 var pieChart = echarts.init(document.getElementById('pie-chart'));
                                 pieChart.setOption(pie_option, true);