72 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			JavaScript
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			72 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			JavaScript
		
	
	
		
			Executable File
		
	
	
	
	
| layui.use(['echarts'], function () {
 | |
|     let echarts = layui.echarts;
 | |
|     var column1 = echarts.init(document.getElementById('project_income'));
 | |
|     option = {
 | |
|         title: {
 | |
|             text: '收入分布',
 | |
|             orient: 'vertical',
 | |
|             //top: 2,
 | |
|             fontSize: 15,
 | |
|             textStyle: {
 | |
|                 color: '#666666',
 | |
|                 fontWeight: 'normal'
 | |
|             },
 | |
|             // subtext: 'Fake Data',
 | |
|             left: 'center'
 | |
|         },
 | |
|         tooltip: {
 | |
|             trigger: 'item'
 | |
|         },
 | |
|         legend: {
 | |
|             left: 'center',
 | |
|             top: 'bottom',
 | |
|             data: ['劳务费用', '顾问费', '场地费', '车辆费', '其他']
 | |
|         },
 | |
|         color: ['#63b2ee', '#76da91', '#f8cb7f', '#f89588', '#7cd6cf', '#9192ab', '#7898e1', '#efa666', '#eddd86', '#9987ce', '#63b2ee', '#76da91'],
 | |
|         series: [
 | |
|             {
 | |
|                 // name: 'Access From',
 | |
|                 type: 'pie',
 | |
|                 radius: '50%',
 | |
|                 data: [
 | |
|                     { value: 1048, name: '劳务费用' },
 | |
|                     { value: 735, name: '顾问费' },
 | |
|                     { value: 580, name: '场地费' },
 | |
|                     { value: 484, name: '车辆费' },
 | |
|                     { value: 300, name: '其他' }
 | |
|                 ],
 | |
|                 emphasis: {
 | |
|                     itemStyle: {
 | |
|                         shadowBlur: 10,
 | |
|                         shadowOffsetX: 0,
 | |
|                         shadowColor: 'rgba(0, 0, 0, 0.5)'
 | |
|                     }
 | |
|                 },
 | |
|                 label: {
 | |
|                     show: true,
 | |
|                     textStyle: {
 | |
|                         color: '#666666',
 | |
|                     },
 | |
|                     normal: {
 | |
|                         // formatter: '{b}:{c}: ({d}%)',
 | |
|                         formatter: '{c} ({d}%)',
 | |
|                         textStyle: {
 | |
|                             fontWeight: 'normal',
 | |
|                             color: '#666666',
 | |
|                         }
 | |
|                     },
 | |
|                     // formatter: function (params) {
 | |
|                     //     var total = params.data.value;
 | |
|                     //     return params.value + ' (' + total + '%)'
 | |
|                     // }
 | |
|                 },
 | |
|             }
 | |
|         ]
 | |
|     };
 | |
| 
 | |
|     column1.setOption(option);
 | |
|     window.onresize = function () {
 | |
|         column1.resize();
 | |
|     }
 | |
| })
 |