Echarts 饼图代码<!DOCTYPE html><head > <meta charset ="utf-8"> <title >ECharts </title ></head ><body > <!-- 为ECharts 准备⼀个具备⼤⼩(宽⾼)的Dom --> <div id ="main" style ="height:400px"></div > <!-- ECharts 单⽂件引⼊ --> <script src ="echarts.baidu/build/dist/echarts.js"></script > <script type ="text/javascript"> // 路径配置 fig({ paths: { echarts: 'echarts.baidu/build/dist' } }); // 使⽤ require( [ 'echarts', 'echarts/chart/line', 'echarts/chart/pie', 'echarts/chart/bar' ], function (ec) { // 基于准备好的dom ,初始化echarts 图表 var myChart = ec.ElementById('main')); option = { tooltip : { show: true , formatter: "{a} <br/>{b} : {c} ({d}%)" }, legend: { orient : 'vertical', x : 'left', data:['组织⽣活正常化','凝聚⼒','战⽃⼒'] }, toolbox: { show : true }, calculable : true , series : [ { name:'访问来源', type:'pie', startAngle: 90, center : ['75%', 200], radius : [80, 120], itemStyle : { normal : { label : { show : true }, labelLine : { show : true } },1
2
3
4
5fontweight几百正常
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
var zrColor = require('zrender/tool/color'); return RadialGradient( 650, 200, 80, 650, 200, 120, [[0, 'rgba(255,255,0,1)'],[1, 'rgba(255,0,0,1)']] ) })(), label : { show : true , position : 'center', formatter : "{d}%", textStyle : { color : 'red', fontSize : '30', fontFamily : '微软雅⿊', fontWeight : 'bold' } } } }, data:[ {value:335, name:'组织⽣活正常化', itemStyle : { normal : { borderWidth: 4, borderColor: '#ffffff', } }}, { value:30, name:'正常化未完成', itemStyle : { normal : { borderWidth: 0, label : { show : false
}, labelLine : { show : false }, color:'#2F4F4F' }, emphasis : { label : { show : true }, labelLine : { show : false }, color:'#2F4F4F' } } }, {value:310, name:'凝聚⼒', itemStyle : { normal : { borderWidth: 4, borderColor: '#ffffff', } }}, { value:50, name:'凝聚⼒未完成', itemStyle : {63646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
label : { show : false }, labelLine : { show : false }, color:'#2F4F4F' }, emphasis : { label : { show : true }, labelLine : { show : false }, color:'#2F4F4F' } } }, {value:234, name:'战⽃⼒', itemStyle : { normal : { borderWidth: 4, bor
derColor: '#ffffff', } }}, { value:40, name:'战⽃⼒未完成', itemStyle : { normal : { borderWidth: 0, label : { show : false }, labelLine : { show : false }, color:'#2F4F4F' }, emphasis : { label : { show : true }, labelLine : { show : false }, color:'#2F4F4F' } } } ] } ] }; // 为echarts 对象加载数据 myChart.setOption(option); } ); </script > </body >128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
专业墙纸贴纸厨房⽤具装饰出售,本⼈⽹店经营
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论