123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911 |
- var Option = {};
- Option.getLastEnterpriseOption = function (type,data) {
- var myEcharts = echarts.init(document.getElementById('e1'),"macarons");
- var title = new Array();
- var detail = new Array();
- var max = 200;
- for(var key in data.obj){
- title.push(data.obj[key].time);
- detail.push(data.obj[key].count);
- if(max<parseInt(data.obj[key].count)){
- max = data.obj[key].count;
- }
- }
- var colors = ['#5793f3', '#d14a61', '#675bba'];
- var option = {
- color: colors,
- tooltip: {
- trigger: 'axis',
- axisPointer: {type: 'cross'}
- },
- grid: {
- right: '20%'
- },
- toolbox: {
- feature: {
- dataView: {show: true, readOnly: false},
- restore: {show: true},
- saveAsImage: {show: true}
- }
- },
- legend: {
- show:false
- },
- xAxis: [
- {
- type: 'category',
- axisTick: {
- alignWithLabel: true
- },
- data: title
- }
- ],
- yAxis: [
- {
- type: 'value',
- name: type==1?'注册量':"认定数",
- min: 0,
- max: max,
- position: 'left',
- axisLine: {
- lineStyle: {
- color: colors[0]
- }
- },
- axisLabel: {
- formatter: '{value} '
- }
- },
- ],
- series: [
- {
- name:'注册量',
- type:'bar',
- data:detail
- },
- ]
- };
- myEcharts.setOption(option);
- }
- Option.talentIdentifyProOption = function (type,data) {
- var myEcharts = echarts.init(document.getElementById('e2'),"macarons");
- myEcharts.clear();
- var titleName = "";
- var title = new Array();
- var detail = new Array();
- var type2Detail = new Array();
- var pro = new Array();
- for(var key in data.obj.res){
- title.push(key);
- detail.push({value: data.obj.res[key], name: key});
- type2Detail.push(data.obj.res[key]);
- pro.push((Math.round(data.obj.res[key] / data.obj.total * 10000) / 100.00)+"%");
- }
- if(type == 1 || type == 4){
- var option = {
- // backgroundColor:"#0B1837",
- color: ["#EAEA26", "#906BF9", "#FE5656", "#01E17E", "#3DD1F9", "#FFAD05",'#95e1d3'],
- grid: {
- left: -100,
- top: 50,
- bottom: 10,
- right: 10,
- containLabel: true
- },
- tooltip: {
- trigger: 'item',
- formatter: "{b} : {c} ({d}%)"
- },
- legend: {
- type: "scroll",
- orient: "vartical",
- // x: "right",
- top: "center",
- right: "15",
- // bottom: "0%",
- itemWidth: 16,
- itemHeight: 8,
- itemGap: 16,
- textStyle: {
- color: '#000000',
- fontSize: 12,
- fontWeight: 0
- },
- data: title
- },
- polar: {},
- angleAxis: {
- interval: 1,
- type: 'category',
- data: [],
- z: 10,
- axisLine: {
- show: false,
- lineStyle: {
- color: "#0B4A6B",
- width: 1,
- type: "solid"
- },
- },
- axisLabel: {
- interval: 0,
- show: true,
- color: "#0B4A6B",
- margin: 8,
- fontSize: 16
- },
- },
- radiusAxis: {
- min: 40,
- max: 120,
- interval: 20,
- axisLine: {
- show: false,
- lineStyle: {
- color: "#0B3E5E",
- width: 1,
- type: "solid"
- },
- },
- axisLabel: {
- formatter: '{value} %',
- show: false,
- padding: [0, 0, 20, 0],
- color: "#0B3E5E",
- fontSize: 16
- },
- splitLine: {
- lineStyle: {
- color: "#0B3E5E",
- width: 2,
- type: "solid"
- }
- }
- },
- calculable: true,
- series: [{
- type: 'pie',
- radius: ["5%", "10%"],
- hoverAnimation: false,
- labelLine: {
- normal: {
- show: false,
- length: 30,
- length2: 55
- },
- emphasis: {
- show: false
- }
- },
- data: [{
- name: '',
- value: 0,
- itemStyle: {
- normal: {
- color: "#0B4A6B"
- }
- }
- }]
- }, {
- type: 'pie',
- radius: ["90%", "95%"],
- hoverAnimation: false,
- labelLine: {
- normal: {
- show: false,
- length: 30,
- length2: 55
- },
- emphasis: {
- show: false
- }
- },
- name: "",
- data: [{
- name: '',
- value: 0,
- itemStyle: {
- normal: {
- color: "#0B4A6B"
- }
- }
- }]
- },{
- stack: 'a',
- type: 'pie',
- radius: ['20%', '80%'],
- roseType: 'area',
- zlevel:10,
- label: {
- normal: {
- show: true,
- formatter: "{c}人",
- textStyle: {
- fontSize: 12,
- },
- position: 'outside'
- },
- emphasis: {
- show: true
- }
- },
- labelLine: {
- normal: {
- show: true,
- length: 20,
- length2: 55
- },
- emphasis: {
- show: false
- }
- },
- data: detail
- }, ]
- }
- // var option = {
- // title: {
- // text: type==1?"人才认定人才层次分布":"人才认定人才来源分布",
- // // subtext: '纯属虚构',
- // left: 'center'
- // },
- // tooltip: {
- // trigger: 'item',
- // formatter: '{a} <br/>{b} : {c} ({d}%)'
- // },
- // legend: {
- // left: 'center',
- // top: 'bottom',
- // show:true,
- // data: data
- // },
- // xAxis: {
- // show:false
- // },
- // yAxis:{
- // show:false
- // },
- // toolbox: {
- // show: true,
- // feature: {
- // mark: {show: true},
- // dataView: {show: true, readOnly: false},
- // magicType: {
- // show: true,
- // type: ['pie', 'funnel']
- // },
- // restore: {show: true},
- // saveAsImage: {show: true}
- // }
- // },
- // series: [
- // {
- // name: titleName,
- // type: 'pie',
- // radius: [30, 110],
- // center: ['50%', '50%'],
- // roseType: 'area',
- // data: detail
- // }
- // ]
- // };
- myEcharts.setOption(option);
- }
- if(type == 2){
- var colorList = ['#f36c6c', '#e6cf4e', '#20d180', '#0093ff','#ca8622', '#bda29a', '#a8d8ea', '#aa96da', '#fcbad3', '#ffffd2'];
- var option = {
- title: {
- text: '人才认定行业领域',
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- },
- formatter: "行业领域"+'<br/>{b} : {c} '
- },
- legend: {
- show: false
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: {
- type: 'value',
- axisLine: {
- show: true
- },
- axisTick: {
- show: true,
- interval:0
- },
- },
- yAxis: {
- inverse: true,
- type: 'category',
- data: title,
- axisLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- axisTick: {
- show: false,
- interval: 0
- },
- },
- series: [
- {
- type: 'bar',
- data: type2Detail.map((item, i) => {
- itemStyle = {
- color: colorList[i]
- }
- return {
- value: item,
- itemStyle: itemStyle
- };
- }),
- label: {
- show: true,
- position: 'right',
- color: '#333333',
- fontSize: 14,
- offset: [10, 0]
- }
- }
- ]
- };
- myEcharts.setOption(option);
- }if(type == 3){
- var colorList = ['#f36c6c', '#e6cf4e', '#20d180', '#0093ff','#ca8622', '#bda29a', '#a8d8ea', '#aa96da', '#fcbad3', '#ffffd2'];
- var option = {
- title: {
- text: '人才认定最高学历分布',
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- },
- formatter: "最高学历"+'<br/>{b} : {c} '
- },
- legend: {
- show: false
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: {
- type: 'value',
- axisLine: {
- show: true
- },
- axisTick: {
- show: true,
- interval:0
- },
- },
- yAxis: {
- inverse: true,
- type: 'category',
- data: title,
- axisLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- axisTick: {
- show: false,
- interval: 0
- },
- },
- series: [
- {
- type: 'bar',
- data: type2Detail.map((item, i) => {
- itemStyle = {
- color: colorList[i]
- }
- return {
- value: item,
- itemStyle: itemStyle
- };
- }),
- label: {
- show: true,
- position: 'right',
- color: '#333333',
- fontSize: 14,
- offset: [10, 0]
- }
- }
- ]
- };
- myEcharts.setOption(option);
- }
- }
- Option.getCountByStreetOption = function (type,data) {
- var res = data.obj.data;
- var total = data.obj.total;
- var myEcharts = echarts.init(document.getElementById('e3'),"macarons");
- var years = new Array();
- var jdData = new Array();
- var resData = new Array();
- for(var key in res){
- years.push(key);
- var tmpData = new Array();
- var resTempData = new Array();
- for(var street in res[key]){
- tmpData.push(street);
- resTempData.push(res[key][street]);
- }
- jdData.push(tmpData);
- resData.push(resTempData);
- }
- var option = {
- baseOption: {
- // backgroundColor: '#2c343c', //背景颜色
- timeline: {
- data: years,
- axisType: 'category',
- autoPlay: true,
- playInterval: 3000, //播放速度
- left: '5%',
- right: '5%',
- bottom: '0%',
- width: '90%',
- // height: null,
- label: {
- normal: {
- textStyle: {
- color: 'red',
- }
- },
- emphasis: {
- textStyle: {
- color: 'red'
- }
- }
- },
- symbolSize: 10,
- lineStyle: {
- color: '#red'
- },
- checkpointStyle: {
- borderColor: '#red',
- borderWidth: 2
- },
- controlStyle: {
- showNextBtn: true,
- showPrevBtn: true,
- normal: {
- color: '#ff8800',
- borderColor: '#ff8800'
- },
- emphasis: {
- color: 'red',
- borderColor: 'red'
- }
- },
- },
- title: {
- text: '',
- right: '2%',
- bottom: '8%',
- textStyle: {
- fontSize: 50,
- color: 'black' //标题字体颜色
- }
- },
- tooltip: {
- 'trigger': 'axis'
- },
- calculable: true,
- grid: {
- left: '8%',
- right: '2%',
- bottom: '6%',
- top: '0%',
- containLabel: true
- },
- label: {
- normal: {
- textStyle: {
- color: 'red'
- }
- }
- },
- yAxis: [{
- nameGap: 50,
- offset: '37',
- 'type': 'category',
- interval: 50,
- //inverse: ture,//图表倒叙或者正序排版
- data: '',
- nameTextStyle: {
- color: 'red'
- },
- axisLabel: {
- //rotate:45,
- show: false,
- textStyle: {
- fontSize: 32,
- color: function(params, Index) { // 标签国家字体颜色
- //color:function(d){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);//随机生成颜色
- var colorarrays = ['#6bc0fb', '#7fec9d', '#fedd8b', '#ffa597', '#84e4dd', '#749f83',
- '#ca8622', '#bda29a', '#a8d8ea', '#aa96da', '#fcbad3', '#ffffd2',
- '#f38181', '#fce38a', '#eaffd0', '#95e1d3', '#e3fdfd', '#749f83', '#ca8622'
- ];
- //console.log("111", Index, colorarrays[Index],params); //打印序列
- return colorarrays[jdData[0].indexOf(params)];
- },
- }, //rotate:45,
- interval: 50
- },
- axisLine: {
- lineStyle: {
- color: 'balck' //Y轴颜色
- },
- },
- splitLine: {
- show: false,
- lineStyle: {
- color: 'balck'
- }
- },
- }],
- xAxis: [{
- 'type': 'value',
- 'name': '',
- splitNumber: 8, //轴线个数
- nameTextStyle: {
- color: 'balck'
- },
- axisLine: {
- lineStyle: {
- color: '#ffa597' //X轴颜色
- }
- },
- axisLabel: {
- formatter: '{value} '
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: '#fedd8b'
- }
- },
- }],
- series: [{
- 'name': '',
- 'type': 'bar',
- markLine: {
- label: {
- normal: {
- show: false
- }
- },
- lineStyle: {
- normal: {
- color: 'red',
- width: 3
- }
- },
- },
- label: {
- normal: {
- show: true,
- position: 'right', //数值显示在右侧
- formatter: '{c}'
- }
- },
- itemStyle: {
- normal: {
- color: function(params) {
- // build a color map as your need.
- //color:function(d){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);//随机生成颜色
- var colorList = ['#6bc0fb', '#7fec9d', '#fedd8b', '#ffa597', '#84e4dd', '#749f83',
- '#ca8622', '#bda29a', '#a8d8ea', '#aa96da', '#fcbad3', '#ffffd2',
- '#f38181', '#fce38a', '#eaffd0', '#95e1d3', '#e3fdfd', '#749f83', '#ca8622'
- ];
- // return colorList[params.dataIndex]
- return colorList[jdData[0].indexOf(params.name)];
- },
- }
- },
- },
- {
- 'name': '',
- 'type': 'bar',
- markLine: {
- label: {
- normal: {
- show: false
- }
- },
- lineStyle: {
- normal: {
- color: 'red',
- width: 3
- }
- },
- },
- barWidth: '50%',
- barGap: '-100%',
- label: {
- normal: {
- show: true,
- position: 'left', //数值显示在右侧
- formatter: function(p) {
- return p.name;
- }
- }
- },
- itemStyle: {
- normal: {
- color: function(params) {
- // build a color map as your need.
- //color:function(d){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);//随机生成颜色
- var colorList = ['#6bc0fb', '#7fec9d', '#fedd8b', '#ffa597', '#84e4dd', '#749f83',
- '#ca8622', '#bda29a', '#a8d8ea', '#aa96da', '#fcbad3', '#ffffd2',
- '#f38181', '#fce38a', '#eaffd0', '#95e1d3', '#e3fdfd', '#749f83', '#ca8622'
- ];
- // return colorList[params.dataIndex]
- // console.log("111", params.name); //打印序列
- return colorList[jdData[0].indexOf(params.name)];
- },
- }
- },
- }
- ],
- animationEasingUpdate: 'quinticInOut',
- animationDurationUpdate: 1500, //动画效果
- },
- options: []
- };
- for (var n = 0; n < years.length; n++) {
- var res = [];
- for (j = 0; j < resData[n].length; j++) {
- res.push({
- name: jdData[n][j],
- value: resData[n][j]
- });
- }
- res.sort(function(a, b) {
- return b.value - a.value;
- }).slice(0, 6);
- res.sort(function(a, b) {
- return a.value - b.value;
- });
- var res1 = [];
- var res2 = [];
- var res3 = [];
- //console.log(res);
- for (t = 0; t < res.length; t++) {
- res1[t] = res[t].name;
- res2[t] = res[t].value;
- res3[t] = (res[t].value/total[years[n]]*100).toFixed(2);
- }
- option.options.push({
- title: {
- text: years[n] + '年'
- },
- yAxis: {
- data: res1,
- },
- series: [{
- data: res2
- }, {
- data: res2
- }]
- });
- }
- myEcharts.setOption(option);
- }
- Option.talentIdentifyChangeOption = function (data) {
- var myEcharts = echarts.init(document.getElementById('e4'),"macarons");
- var xData = new Array();
- var totalData = new Array();
- var boyData = new Array();
- var girlData = new Array();
- for(var key in data.obj){
- xData.push(key);
- totalData.push(data.obj[key].total);
- boyData.push(data.obj[key].boy);
- girlData.push(data.obj[key].girl);
- }
- var option = {
- // backgroundColor: "#344b58",
- "title": {
- "text": "近几年人才认定数走势图",
- x: "4%",
- textStyle: {
- color: '#fff',
- fontSize: '22'
- },
- subtextStyle: {
- color: '#90979c',
- fontSize: '16',
- },
- },
- "tooltip": {
- "trigger": "axis",
- "axisPointer": {
- "type": "shadow",
- textStyle: {
- color: "#fff"
- }
- },
- },
- "grid": {
- "borderWidth": 0,
- "top": 110,
- "bottom": 95,
- textStyle: {
- color: "#fff"
- }
- },
- "legend": {
- x: '4%',
- top: '8%',
- textStyle: {
- color: '#90979c',
- },
- "data": ['女', '男', '平均']
- },
- "calculable": true,
- "xAxis": [{
- "type": "category",
- "axisLine": {
- lineStyle: {
- color: '#90979c'
- }
- },
- "splitLine": {
- "show": false
- },
- "axisTick": {
- "show": false
- },
- "splitArea": {
- "show": false
- },
- "axisLabel": {
- "interval": 0,
- },
- "data": xData,
- }],
- "yAxis": [{
- "type": "value",
- "splitLine": {
- "show": false
- },
- "axisLine": {
- lineStyle: {
- color: '#90979c'
- }
- },
- "axisTick": {
- "show": false
- },
- "axisLabel": {
- "interval": 0,
- },
- "splitArea": {
- "show": false
- },
- }],
- "dataZoom": [{
- "show": true,
- "height": 30,
- "xAxisIndex": [
- 0
- ],
- bottom: 30,
- "start": 10,
- "end": 80,
- handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
- handleSize: '110%',
- handleStyle:{
- color:"#d3dee5",
- },
- textStyle:{
- color:"#fff"},
- borderColor:"#90979c"
- }, {
- "type": "inside",
- "show": true,
- "height": 15,
- "start": 1,
- "end": 35
- }],
- "series": [{
- "name": "女",
- "type": "bar",
- "stack": "总量",
- "barMaxWidth": 35,
- "barGap": "10%",
- "itemStyle": {
- "normal": {
- "color": "rgba(255,144,128,1)",
- "label": {
- "show": true,
- "textStyle": {
- "color": "#fff"
- },
- "position": "inside",
- formatter: function(p) {
- return p.value > 0 ? (p.value) : '';
- }
- }
- }
- },
- "data": girlData,
- },
- {
- "name": "男",
- "type": "bar",
- "stack": "总量",
- "itemStyle": {
- "normal": {
- "color": "rgba(0,191,183,1)",
- "barBorderRadius": 0,
- "label": {
- "show": true,
- "position": "inside",
- formatter: function(p) {
- return p.value > 0 ? (p.value) : '';
- }
- }
- }
- },
- "data":boyData
- }, {
- "name": "总数",
- "type": "line",
- symbolSize:10,
- symbol:'circle',
- "itemStyle": {
- "normal": {
- "color": "rgba(252,230,48,1)",
- "barBorderRadius": 0,
- "label": {
- "show": true,
- "position": "top",
- formatter: function(p) {
- return p.value > 0 ? (p.value) : '';
- }
- }
- }
- },
- "data": totalData
- },
- ]
- }
- myEcharts.setOption(option);
- }
|