echartsOption.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911
  1. var Option = {};
  2. Option.getLastEnterpriseOption = function (type,data) {
  3. var myEcharts = echarts.init(document.getElementById('e1'),"macarons");
  4. var title = new Array();
  5. var detail = new Array();
  6. var max = 200;
  7. for(var key in data.obj){
  8. title.push(data.obj[key].time);
  9. detail.push(data.obj[key].count);
  10. if(max<parseInt(data.obj[key].count)){
  11. max = data.obj[key].count;
  12. }
  13. }
  14. var colors = ['#5793f3', '#d14a61', '#675bba'];
  15. var option = {
  16. color: colors,
  17. tooltip: {
  18. trigger: 'axis',
  19. axisPointer: {type: 'cross'}
  20. },
  21. grid: {
  22. right: '20%'
  23. },
  24. toolbox: {
  25. feature: {
  26. dataView: {show: true, readOnly: false},
  27. restore: {show: true},
  28. saveAsImage: {show: true}
  29. }
  30. },
  31. legend: {
  32. show:false
  33. },
  34. xAxis: [
  35. {
  36. type: 'category',
  37. axisTick: {
  38. alignWithLabel: true
  39. },
  40. data: title
  41. }
  42. ],
  43. yAxis: [
  44. {
  45. type: 'value',
  46. name: type==1?'注册量':"认定数",
  47. min: 0,
  48. max: max,
  49. position: 'left',
  50. axisLine: {
  51. lineStyle: {
  52. color: colors[0]
  53. }
  54. },
  55. axisLabel: {
  56. formatter: '{value} '
  57. }
  58. },
  59. ],
  60. series: [
  61. {
  62. name:'注册量',
  63. type:'bar',
  64. data:detail
  65. },
  66. ]
  67. };
  68. myEcharts.setOption(option);
  69. }
  70. Option.talentIdentifyProOption = function (type,data) {
  71. var myEcharts = echarts.init(document.getElementById('e2'),"macarons");
  72. myEcharts.clear();
  73. var titleName = "";
  74. var title = new Array();
  75. var detail = new Array();
  76. var type2Detail = new Array();
  77. var pro = new Array();
  78. for(var key in data.obj.res){
  79. title.push(key);
  80. detail.push({value: data.obj.res[key], name: key});
  81. type2Detail.push(data.obj.res[key]);
  82. pro.push((Math.round(data.obj.res[key] / data.obj.total * 10000) / 100.00)+"%");
  83. }
  84. if(type == 1 || type == 4){
  85. var option = {
  86. // backgroundColor:"#0B1837",
  87. color: ["#EAEA26", "#906BF9", "#FE5656", "#01E17E", "#3DD1F9", "#FFAD05",'#95e1d3'],
  88. grid: {
  89. left: -100,
  90. top: 50,
  91. bottom: 10,
  92. right: 10,
  93. containLabel: true
  94. },
  95. tooltip: {
  96. trigger: 'item',
  97. formatter: "{b} : {c} ({d}%)"
  98. },
  99. legend: {
  100. type: "scroll",
  101. orient: "vartical",
  102. // x: "right",
  103. top: "center",
  104. right: "15",
  105. // bottom: "0%",
  106. itemWidth: 16,
  107. itemHeight: 8,
  108. itemGap: 16,
  109. textStyle: {
  110. color: '#000000',
  111. fontSize: 12,
  112. fontWeight: 0
  113. },
  114. data: title
  115. },
  116. polar: {},
  117. angleAxis: {
  118. interval: 1,
  119. type: 'category',
  120. data: [],
  121. z: 10,
  122. axisLine: {
  123. show: false,
  124. lineStyle: {
  125. color: "#0B4A6B",
  126. width: 1,
  127. type: "solid"
  128. },
  129. },
  130. axisLabel: {
  131. interval: 0,
  132. show: true,
  133. color: "#0B4A6B",
  134. margin: 8,
  135. fontSize: 16
  136. },
  137. },
  138. radiusAxis: {
  139. min: 40,
  140. max: 120,
  141. interval: 20,
  142. axisLine: {
  143. show: false,
  144. lineStyle: {
  145. color: "#0B3E5E",
  146. width: 1,
  147. type: "solid"
  148. },
  149. },
  150. axisLabel: {
  151. formatter: '{value} %',
  152. show: false,
  153. padding: [0, 0, 20, 0],
  154. color: "#0B3E5E",
  155. fontSize: 16
  156. },
  157. splitLine: {
  158. lineStyle: {
  159. color: "#0B3E5E",
  160. width: 2,
  161. type: "solid"
  162. }
  163. }
  164. },
  165. calculable: true,
  166. series: [{
  167. type: 'pie',
  168. radius: ["5%", "10%"],
  169. hoverAnimation: false,
  170. labelLine: {
  171. normal: {
  172. show: false,
  173. length: 30,
  174. length2: 55
  175. },
  176. emphasis: {
  177. show: false
  178. }
  179. },
  180. data: [{
  181. name: '',
  182. value: 0,
  183. itemStyle: {
  184. normal: {
  185. color: "#0B4A6B"
  186. }
  187. }
  188. }]
  189. }, {
  190. type: 'pie',
  191. radius: ["90%", "95%"],
  192. hoverAnimation: false,
  193. labelLine: {
  194. normal: {
  195. show: false,
  196. length: 30,
  197. length2: 55
  198. },
  199. emphasis: {
  200. show: false
  201. }
  202. },
  203. name: "",
  204. data: [{
  205. name: '',
  206. value: 0,
  207. itemStyle: {
  208. normal: {
  209. color: "#0B4A6B"
  210. }
  211. }
  212. }]
  213. },{
  214. stack: 'a',
  215. type: 'pie',
  216. radius: ['20%', '80%'],
  217. roseType: 'area',
  218. zlevel:10,
  219. label: {
  220. normal: {
  221. show: true,
  222. formatter: "{c}人",
  223. textStyle: {
  224. fontSize: 12,
  225. },
  226. position: 'outside'
  227. },
  228. emphasis: {
  229. show: true
  230. }
  231. },
  232. labelLine: {
  233. normal: {
  234. show: true,
  235. length: 20,
  236. length2: 55
  237. },
  238. emphasis: {
  239. show: false
  240. }
  241. },
  242. data: detail
  243. }, ]
  244. }
  245. // var option = {
  246. // title: {
  247. // text: type==1?"人才认定人才层次分布":"人才认定人才来源分布",
  248. // // subtext: '纯属虚构',
  249. // left: 'center'
  250. // },
  251. // tooltip: {
  252. // trigger: 'item',
  253. // formatter: '{a} <br/>{b} : {c} ({d}%)'
  254. // },
  255. // legend: {
  256. // left: 'center',
  257. // top: 'bottom',
  258. // show:true,
  259. // data: data
  260. // },
  261. // xAxis: {
  262. // show:false
  263. // },
  264. // yAxis:{
  265. // show:false
  266. // },
  267. // toolbox: {
  268. // show: true,
  269. // feature: {
  270. // mark: {show: true},
  271. // dataView: {show: true, readOnly: false},
  272. // magicType: {
  273. // show: true,
  274. // type: ['pie', 'funnel']
  275. // },
  276. // restore: {show: true},
  277. // saveAsImage: {show: true}
  278. // }
  279. // },
  280. // series: [
  281. // {
  282. // name: titleName,
  283. // type: 'pie',
  284. // radius: [30, 110],
  285. // center: ['50%', '50%'],
  286. // roseType: 'area',
  287. // data: detail
  288. // }
  289. // ]
  290. // };
  291. myEcharts.setOption(option);
  292. }
  293. if(type == 2){
  294. var colorList = ['#f36c6c', '#e6cf4e', '#20d180', '#0093ff','#ca8622', '#bda29a', '#a8d8ea', '#aa96da', '#fcbad3', '#ffffd2'];
  295. var option = {
  296. title: {
  297. text: '人才认定行业领域',
  298. },
  299. tooltip: {
  300. trigger: 'axis',
  301. axisPointer: {
  302. type: 'shadow'
  303. },
  304. formatter: "行业领域"+'<br/>{b} : {c} '
  305. },
  306. legend: {
  307. show: false
  308. },
  309. grid: {
  310. left: '3%',
  311. right: '4%',
  312. bottom: '3%',
  313. containLabel: true
  314. },
  315. xAxis: {
  316. type: 'value',
  317. axisLine: {
  318. show: true
  319. },
  320. axisTick: {
  321. show: true,
  322. interval:0
  323. },
  324. },
  325. yAxis: {
  326. inverse: true,
  327. type: 'category',
  328. data: title,
  329. axisLine: {
  330. show: false
  331. },
  332. axisTick: {
  333. show: false
  334. },
  335. axisTick: {
  336. show: false,
  337. interval: 0
  338. },
  339. },
  340. series: [
  341. {
  342. type: 'bar',
  343. data: type2Detail.map((item, i) => {
  344. itemStyle = {
  345. color: colorList[i]
  346. }
  347. return {
  348. value: item,
  349. itemStyle: itemStyle
  350. };
  351. }),
  352. label: {
  353. show: true,
  354. position: 'right',
  355. color: '#333333',
  356. fontSize: 14,
  357. offset: [10, 0]
  358. }
  359. }
  360. ]
  361. };
  362. myEcharts.setOption(option);
  363. }if(type == 3){
  364. var colorList = ['#f36c6c', '#e6cf4e', '#20d180', '#0093ff','#ca8622', '#bda29a', '#a8d8ea', '#aa96da', '#fcbad3', '#ffffd2'];
  365. var option = {
  366. title: {
  367. text: '人才认定最高学历分布',
  368. },
  369. tooltip: {
  370. trigger: 'axis',
  371. axisPointer: {
  372. type: 'shadow'
  373. },
  374. formatter: "最高学历"+'<br/>{b} : {c} '
  375. },
  376. legend: {
  377. show: false
  378. },
  379. grid: {
  380. left: '3%',
  381. right: '4%',
  382. bottom: '3%',
  383. containLabel: true
  384. },
  385. xAxis: {
  386. type: 'value',
  387. axisLine: {
  388. show: true
  389. },
  390. axisTick: {
  391. show: true,
  392. interval:0
  393. },
  394. },
  395. yAxis: {
  396. inverse: true,
  397. type: 'category',
  398. data: title,
  399. axisLine: {
  400. show: false
  401. },
  402. axisTick: {
  403. show: false
  404. },
  405. axisTick: {
  406. show: false,
  407. interval: 0
  408. },
  409. },
  410. series: [
  411. {
  412. type: 'bar',
  413. data: type2Detail.map((item, i) => {
  414. itemStyle = {
  415. color: colorList[i]
  416. }
  417. return {
  418. value: item,
  419. itemStyle: itemStyle
  420. };
  421. }),
  422. label: {
  423. show: true,
  424. position: 'right',
  425. color: '#333333',
  426. fontSize: 14,
  427. offset: [10, 0]
  428. }
  429. }
  430. ]
  431. };
  432. myEcharts.setOption(option);
  433. }
  434. }
  435. Option.getCountByStreetOption = function (type,data) {
  436. var res = data.obj.data;
  437. var total = data.obj.total;
  438. var myEcharts = echarts.init(document.getElementById('e3'),"macarons");
  439. var years = new Array();
  440. var jdData = new Array();
  441. var resData = new Array();
  442. for(var key in res){
  443. years.push(key);
  444. var tmpData = new Array();
  445. var resTempData = new Array();
  446. for(var street in res[key]){
  447. tmpData.push(street);
  448. resTempData.push(res[key][street]);
  449. }
  450. jdData.push(tmpData);
  451. resData.push(resTempData);
  452. }
  453. var option = {
  454. baseOption: {
  455. // backgroundColor: '#2c343c', //背景颜色
  456. timeline: {
  457. data: years,
  458. axisType: 'category',
  459. autoPlay: true,
  460. playInterval: 3000, //播放速度
  461. left: '5%',
  462. right: '5%',
  463. bottom: '0%',
  464. width: '90%',
  465. // height: null,
  466. label: {
  467. normal: {
  468. textStyle: {
  469. color: 'red',
  470. }
  471. },
  472. emphasis: {
  473. textStyle: {
  474. color: 'red'
  475. }
  476. }
  477. },
  478. symbolSize: 10,
  479. lineStyle: {
  480. color: '#red'
  481. },
  482. checkpointStyle: {
  483. borderColor: '#red',
  484. borderWidth: 2
  485. },
  486. controlStyle: {
  487. showNextBtn: true,
  488. showPrevBtn: true,
  489. normal: {
  490. color: '#ff8800',
  491. borderColor: '#ff8800'
  492. },
  493. emphasis: {
  494. color: 'red',
  495. borderColor: 'red'
  496. }
  497. },
  498. },
  499. title: {
  500. text: '',
  501. right: '2%',
  502. bottom: '8%',
  503. textStyle: {
  504. fontSize: 50,
  505. color: 'black' //标题字体颜色
  506. }
  507. },
  508. tooltip: {
  509. 'trigger': 'axis'
  510. },
  511. calculable: true,
  512. grid: {
  513. left: '8%',
  514. right: '2%',
  515. bottom: '6%',
  516. top: '0%',
  517. containLabel: true
  518. },
  519. label: {
  520. normal: {
  521. textStyle: {
  522. color: 'red'
  523. }
  524. }
  525. },
  526. yAxis: [{
  527. nameGap: 50,
  528. offset: '37',
  529. 'type': 'category',
  530. interval: 50,
  531. //inverse: ture,//图表倒叙或者正序排版
  532. data: '',
  533. nameTextStyle: {
  534. color: 'red'
  535. },
  536. axisLabel: {
  537. //rotate:45,
  538. show: false,
  539. textStyle: {
  540. fontSize: 32,
  541. color: function(params, Index) { // 标签国家字体颜色
  542. //color:function(d){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);//随机生成颜色
  543. var colorarrays = ['#6bc0fb', '#7fec9d', '#fedd8b', '#ffa597', '#84e4dd', '#749f83',
  544. '#ca8622', '#bda29a', '#a8d8ea', '#aa96da', '#fcbad3', '#ffffd2',
  545. '#f38181', '#fce38a', '#eaffd0', '#95e1d3', '#e3fdfd', '#749f83', '#ca8622'
  546. ];
  547. //console.log("111", Index, colorarrays[Index],params); //打印序列
  548. return colorarrays[jdData[0].indexOf(params)];
  549. },
  550. }, //rotate:45,
  551. interval: 50
  552. },
  553. axisLine: {
  554. lineStyle: {
  555. color: 'balck' //Y轴颜色
  556. },
  557. },
  558. splitLine: {
  559. show: false,
  560. lineStyle: {
  561. color: 'balck'
  562. }
  563. },
  564. }],
  565. xAxis: [{
  566. 'type': 'value',
  567. 'name': '',
  568. splitNumber: 8, //轴线个数
  569. nameTextStyle: {
  570. color: 'balck'
  571. },
  572. axisLine: {
  573. lineStyle: {
  574. color: '#ffa597' //X轴颜色
  575. }
  576. },
  577. axisLabel: {
  578. formatter: '{value} '
  579. },
  580. splitLine: {
  581. show: true,
  582. lineStyle: {
  583. color: '#fedd8b'
  584. }
  585. },
  586. }],
  587. series: [{
  588. 'name': '',
  589. 'type': 'bar',
  590. markLine: {
  591. label: {
  592. normal: {
  593. show: false
  594. }
  595. },
  596. lineStyle: {
  597. normal: {
  598. color: 'red',
  599. width: 3
  600. }
  601. },
  602. },
  603. label: {
  604. normal: {
  605. show: true,
  606. position: 'right', //数值显示在右侧
  607. formatter: '{c}'
  608. }
  609. },
  610. itemStyle: {
  611. normal: {
  612. color: function(params) {
  613. // build a color map as your need.
  614. //color:function(d){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);//随机生成颜色
  615. var colorList = ['#6bc0fb', '#7fec9d', '#fedd8b', '#ffa597', '#84e4dd', '#749f83',
  616. '#ca8622', '#bda29a', '#a8d8ea', '#aa96da', '#fcbad3', '#ffffd2',
  617. '#f38181', '#fce38a', '#eaffd0', '#95e1d3', '#e3fdfd', '#749f83', '#ca8622'
  618. ];
  619. // return colorList[params.dataIndex]
  620. return colorList[jdData[0].indexOf(params.name)];
  621. },
  622. }
  623. },
  624. },
  625. {
  626. 'name': '',
  627. 'type': 'bar',
  628. markLine: {
  629. label: {
  630. normal: {
  631. show: false
  632. }
  633. },
  634. lineStyle: {
  635. normal: {
  636. color: 'red',
  637. width: 3
  638. }
  639. },
  640. },
  641. barWidth: '50%',
  642. barGap: '-100%',
  643. label: {
  644. normal: {
  645. show: true,
  646. position: 'left', //数值显示在右侧
  647. formatter: function(p) {
  648. return p.name;
  649. }
  650. }
  651. },
  652. itemStyle: {
  653. normal: {
  654. color: function(params) {
  655. // build a color map as your need.
  656. //color:function(d){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);//随机生成颜色
  657. var colorList = ['#6bc0fb', '#7fec9d', '#fedd8b', '#ffa597', '#84e4dd', '#749f83',
  658. '#ca8622', '#bda29a', '#a8d8ea', '#aa96da', '#fcbad3', '#ffffd2',
  659. '#f38181', '#fce38a', '#eaffd0', '#95e1d3', '#e3fdfd', '#749f83', '#ca8622'
  660. ];
  661. // return colorList[params.dataIndex]
  662. // console.log("111", params.name); //打印序列
  663. return colorList[jdData[0].indexOf(params.name)];
  664. },
  665. }
  666. },
  667. }
  668. ],
  669. animationEasingUpdate: 'quinticInOut',
  670. animationDurationUpdate: 1500, //动画效果
  671. },
  672. options: []
  673. };
  674. for (var n = 0; n < years.length; n++) {
  675. var res = [];
  676. for (j = 0; j < resData[n].length; j++) {
  677. res.push({
  678. name: jdData[n][j],
  679. value: resData[n][j]
  680. });
  681. }
  682. res.sort(function(a, b) {
  683. return b.value - a.value;
  684. }).slice(0, 6);
  685. res.sort(function(a, b) {
  686. return a.value - b.value;
  687. });
  688. var res1 = [];
  689. var res2 = [];
  690. var res3 = [];
  691. //console.log(res);
  692. for (t = 0; t < res.length; t++) {
  693. res1[t] = res[t].name;
  694. res2[t] = res[t].value;
  695. res3[t] = (res[t].value/total[years[n]]*100).toFixed(2);
  696. }
  697. option.options.push({
  698. title: {
  699. text: years[n] + '年'
  700. },
  701. yAxis: {
  702. data: res1,
  703. },
  704. series: [{
  705. data: res2
  706. }, {
  707. data: res2
  708. }]
  709. });
  710. }
  711. myEcharts.setOption(option);
  712. }
  713. Option.talentIdentifyChangeOption = function (data) {
  714. var myEcharts = echarts.init(document.getElementById('e4'),"macarons");
  715. var xData = new Array();
  716. var totalData = new Array();
  717. var boyData = new Array();
  718. var girlData = new Array();
  719. for(var key in data.obj){
  720. xData.push(key);
  721. totalData.push(data.obj[key].total);
  722. boyData.push(data.obj[key].boy);
  723. girlData.push(data.obj[key].girl);
  724. }
  725. var option = {
  726. // backgroundColor: "#344b58",
  727. "title": {
  728. "text": "近几年人才认定数走势图",
  729. x: "4%",
  730. textStyle: {
  731. color: '#fff',
  732. fontSize: '22'
  733. },
  734. subtextStyle: {
  735. color: '#90979c',
  736. fontSize: '16',
  737. },
  738. },
  739. "tooltip": {
  740. "trigger": "axis",
  741. "axisPointer": {
  742. "type": "shadow",
  743. textStyle: {
  744. color: "#fff"
  745. }
  746. },
  747. },
  748. "grid": {
  749. "borderWidth": 0,
  750. "top": 110,
  751. "bottom": 95,
  752. textStyle: {
  753. color: "#fff"
  754. }
  755. },
  756. "legend": {
  757. x: '4%',
  758. top: '8%',
  759. textStyle: {
  760. color: '#90979c',
  761. },
  762. "data": ['女', '男', '平均']
  763. },
  764. "calculable": true,
  765. "xAxis": [{
  766. "type": "category",
  767. "axisLine": {
  768. lineStyle: {
  769. color: '#90979c'
  770. }
  771. },
  772. "splitLine": {
  773. "show": false
  774. },
  775. "axisTick": {
  776. "show": false
  777. },
  778. "splitArea": {
  779. "show": false
  780. },
  781. "axisLabel": {
  782. "interval": 0,
  783. },
  784. "data": xData,
  785. }],
  786. "yAxis": [{
  787. "type": "value",
  788. "splitLine": {
  789. "show": false
  790. },
  791. "axisLine": {
  792. lineStyle: {
  793. color: '#90979c'
  794. }
  795. },
  796. "axisTick": {
  797. "show": false
  798. },
  799. "axisLabel": {
  800. "interval": 0,
  801. },
  802. "splitArea": {
  803. "show": false
  804. },
  805. }],
  806. "dataZoom": [{
  807. "show": true,
  808. "height": 30,
  809. "xAxisIndex": [
  810. 0
  811. ],
  812. bottom: 30,
  813. "start": 10,
  814. "end": 80,
  815. 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',
  816. handleSize: '110%',
  817. handleStyle:{
  818. color:"#d3dee5",
  819. },
  820. textStyle:{
  821. color:"#fff"},
  822. borderColor:"#90979c"
  823. }, {
  824. "type": "inside",
  825. "show": true,
  826. "height": 15,
  827. "start": 1,
  828. "end": 35
  829. }],
  830. "series": [{
  831. "name": "女",
  832. "type": "bar",
  833. "stack": "总量",
  834. "barMaxWidth": 35,
  835. "barGap": "10%",
  836. "itemStyle": {
  837. "normal": {
  838. "color": "rgba(255,144,128,1)",
  839. "label": {
  840. "show": true,
  841. "textStyle": {
  842. "color": "#fff"
  843. },
  844. "position": "inside",
  845. formatter: function(p) {
  846. return p.value > 0 ? (p.value) : '';
  847. }
  848. }
  849. }
  850. },
  851. "data": girlData,
  852. },
  853. {
  854. "name": "男",
  855. "type": "bar",
  856. "stack": "总量",
  857. "itemStyle": {
  858. "normal": {
  859. "color": "rgba(0,191,183,1)",
  860. "barBorderRadius": 0,
  861. "label": {
  862. "show": true,
  863. "position": "inside",
  864. formatter: function(p) {
  865. return p.value > 0 ? (p.value) : '';
  866. }
  867. }
  868. }
  869. },
  870. "data":boyData
  871. }, {
  872. "name": "总数",
  873. "type": "line",
  874. symbolSize:10,
  875. symbol:'circle',
  876. "itemStyle": {
  877. "normal": {
  878. "color": "rgba(252,230,48,1)",
  879. "barBorderRadius": 0,
  880. "label": {
  881. "show": true,
  882. "position": "top",
  883. formatter: function(p) {
  884. return p.value > 0 ? (p.value) : '';
  885. }
  886. }
  887. }
  888. },
  889. "data": totalData
  890. },
  891. ]
  892. }
  893. myEcharts.setOption(option);
  894. }