| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- function load_guage(datax,datay1,datay2){
- var option = {
- legend: {
- x : 'center',
- y : 'center',
- show:false,
- data:[
- '剧情', '奇幻', '爱情', '惊悚', '冒险', '动作', '喜剧', '科幻','悬疑','犯罪'
- ]
- },
- title : {
- text: '剧情',
- x: 'center',
- y:'center',
- show:true,
- textStyle: {
- color : 'red',
- fontSize: 16
- }
- },
- toolbox: {
- show : false,
- feature : {
- dataView : {show: true, readOnly: false},
- magicType : {
- show: true,
- type: ['pie', 'funnel'],
- option: {
- funnel: {
- width: '20%',
- height: '30%',
- itemStyle : {
- normal : {
- label : {
- formatter : function (params){
- return 'other\n' + params.value + '%\n'
- },
- textStyle: {
- baseline : 'middle',
- }
- }
- },
- }
- }
- }
- },
- restore : {show: true},
- saveAsImage : {show: true}
- }
- },
- series : [
- {
- type : 'pie',
- center : ['50%', '50%'],
- radius : ['35%','55%'],
- x: '50%', // for funnel
- itemStyle : {
- normal : {
- label : {
- textStyle: {
- baseline : 'center',
- position : 'inside',
- }
- },
- color:'red'
- },
- },
- labelLine : {
- show : false
- },
- label : {
- show : false,
- position : 'inside',
- formatter : '{b}',
- textStyle: {
- baseline : 'bottom',
- fontSize: 16
- }
- },
- data : [
- {name:'', value:datay1[1],
- itemStyle : {
- normal : {
- }
- }
- },
- {name:'', value:datay1[0],
- itemStyle : {
- normal : {
- color: 'rgba(175,169,169,.4)',
- label : {
- show : false,
- position : 'inside'
- }
- },
- emphasis: {
- color: 'rgba(0,0,0,0)'
- }
- }
- }
- ]
- },
- {
- type : 'pie',
- center : ['50%', '50%'],
- radius : ['35%','45%'],
- itemStyle : {
- normal : {
- label : {
- textStyle: {
- baseline : 'top'
- }
- },
- color:'blue'
- },
- },
- labelLine : {
- show : false
- },
- label : {
- show : false,
- position : 'inside',
- formatter : '{b}',
- textStyle: {
- baseline : 'bottom'
- }
- },
- data : [
- {name:'', value:datay2[1],
- itemStyle : {
- normal : {
- }
- }
- },
- {name:'', value:datay2[0],
- itemStyle : {
- normal : {
- color: 'rgba(96,96,96,.5)',
- label : {
- show : false,
- position : 'inside'
- }
- },
- emphasis: {
- color: 'rgba(0,0,0,0)'
- }
- }
- },
- ]
- }
- ],
- animationDuration:7000,
- animationEasing:'elasticOut',
- animationDelayupdate:function(idx){
- return idx * 15;
- }
- };
- return option;
- }
|