您当前的位置: 首页 >  ar

150Echarts - 旭日图(Sunburst Label Rotate)

杨林伟 发布时间:2019-05-05 14:35:38 ,浏览量:4

效果图

在这里插入图片描述

源代码



	
		
		ECharts
		
		
		
		
	

	
		
		
// 基于准备好的dom,初始化echarts实例 var myChart = echarts.init(document.getElementById('main')); var option; option = { silent: true, series: { radius: ['15%', '80%'], type: 'sunburst', sort: null, highlightPolicy: 'ancestor', data: [{ value: 8, children: [{ value: 4, children: [{ value: 2 }, { value: 1 }, { value: 1 }, { value: 0.5 }] }, { value: 2 }] }, { value: 4, children: [{ children: [{ value: 2 }] }] }, { value: 4, children: [{ children: [{ value: 2 }] }] }, { value: 3, children: [{ children: [{ value: 1 }] }] }], label: { color: '#fff', textBorderColor: '#666', textBorderWidth: 2, borderColor: '#999', borderWidth: 1, formatter: function (param) { var depth = param.treePathInfo.length; if (depth === 2) { return 'radial'; } else if (depth === 3) { return 'tangential'; } else if (depth === 4) { return '0'; } } }, levels: [{}, { itemStyle: { color: 'red' }, label: { rotate: 'radial' } }, { itemStyle: { color: 'orange' }, label: { rotate: 'tangential' } }, { itemStyle: { color: 'yellow' }, label: { rotate: 0 } }] } }; myChart.setOption(option);
关注
打赏
1688896170
查看更多评论

杨林伟

暂无认证

  • 4浏览

    0关注

    3183博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.2889s