echart环形玫瑰图

227 阅读1分钟
let namelist = ['0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23'];
let percentList = [1, 3, 1, 4, 4, 6, 10, 5, 6, 9, 20, 10, 8, 13, 2, 3];
option = {
		backgroundColor: '#fff',
	    angleAxis: {
	        type: 'category',
			startAngle: 97,
			splitLine: {
				show: true,
				lineStyle: {
					color: '#9a9a9a',
					width: 1,
					
				}
			},
			splitArea:{
			 show:true,
			 areaStyle:{
			  color:'#00f',
			  opacity:0.1
			 }
			},
			axisLine: {
				show: true,
				lineStyle: {
					color: '#05f',
					width: 2,
					
				}
			},
			axisLabel: {
				show: true,
				color: '#1c2383',
				fontWeight: 'bold',
				formatter: '{value} 时'
			},
			z: 10,
	        data: namelist
	    },
	    radiusAxis: {
	    	z: 20,
	    	axisLabel: {
	    		show: false,
	    	},
	    	splitLine: {
	    		show: false,
	    	},
	    	axisLine: {
	    		show: false,
	    	},
	    },
	    polar: {
	      radius: ["20%", "90%"]
	    },
		tooltip: {
			trigger: 'item',
		},
	    series: [
	     {
	        type: 'bar',
			      barWidth: '99%',
	        data: percentList,
	        coordinateSystem: 'polar',
	        color: ['#999'],

	    }]
	};